Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-06-2010, 06:57 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 140
Default Basic Shooter Consecutive Hits Help

Hey there,
I was wondering if anyone could help me with my simple shooter game. There are falling objects at the top of the screen that the shoot hits. What I want to do is detect consecutive hits and give the user awards at certain amounts of consecutive hits. Some things you should know is that my game is 2D (not cocoas2D), and uses the CGRectIntersectsRect method of collision.

Any help is greatly appreciated!

Thanks,
Kirby
ybrikeeg is offline   Reply With Quote
Old 09-06-2010, 07:03 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,129
Default

Code:
if (theyIntersect)
   hitCount++;
__________________
BriTer Ideas LLC - Code review, consulting, development. PM for pricing.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
BrianSlick is offline   Reply With Quote
Old 09-06-2010, 07:06 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 140
Default

Quote:
Originally Posted by BrianSlick View Post
Code:
if (theyIntersect)
   hitCount++;
Yes, I've tried that. But the problem is resetting it when the bullet (from the shooter) hits the top of the screen
ybrikeeg is offline   Reply With Quote
Old 09-06-2010, 07:07 PM   #4 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,129
Default

Code:
if (itIsOutOfBounds)
   hitCount = 0;
__________________
BriTer Ideas LLC - Code review, consulting, development. PM for pricing.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
BrianSlick is offline   Reply With Quote
Old 09-06-2010, 07:47 PM   #5 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,178
Default

Quote:
Originally Posted by BrianSlick View Post
Code:
if (theyIntersect)
   hitCount++;
Code:
if (itIsOutOfBounds)
   hitCount = 0;
I want to work with you on my next game.
__________________
~~ Word Flurry ~~ App Store / Website / Facebook
Kalimba is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 252
19 members and 233 guests
ADY, Alsahir, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, Herbie, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, Robiwan, smethorst, spiderguy84, twerner
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:42 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0