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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-05-2010, 12:46 PM   #29 (permalink)
iPhoneDevelopment
Banned
 
Join Date: Dec 2009
Posts: 61
iPhoneDevelopment is on a distinguished road
Default

Ok I'll start at the beginning:

When the user swipes up on the screen, the character (a uiimageview) jumps. The idea of the game is to make him jump from block to block to prevent him from falling off the bottom of the screen. To achieve this, 'gravity' needs to be applied (just an addition of +15 to his center.y value) if he is not in the process of jumping or resting on a block. My problem is that 'gravity' must not be applied until after the first swipe, so that the game can commence without him disappearing, and I have done this by detecting if firstSwipe == true in my gameLoop. I thought that if I set firstSwipe = true in the jump method, the gravity would only become active if no other movement was happening, but as the gameLoop is called 30 times a second, the character falls before he jumps.

If I still haven't made it clear (which is a big possibility), I will post my code to see if that makes more sense than my ramblings.

One other quick point - how do I access my blocks in my arrays blockArray and Stopped blocks? With a 'for (block in blockArray, stoppedBlocks)' method?

Thanks a lot for all your help

Cam

Last edited by iPhoneDevelopment; 02-05-2010 at 02:18 PM.
iPhoneDevelopment is offline   Reply With Quote
 

» Advertisements
» Online Users: 526
13 members and 513 guests
cch4d10, Domele, Hassasin, headkaze, ilmman, jbro, jeiry, kasumar, linetteqi95, nebulabox, sangsom, smithms, SuperDietGenius
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,446
Threads: 94,031
Posts: 402,604
Top Poster: BrianSlick (7,978)
Welcome to our newest member, larueta13
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:16 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.