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

View Single Post
Old 01-31-2010, 12:06 PM   #16 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

I don't see any syntax errors in that code, except that you declared "UITouch *touch" twice in the same method. The second time you assign that variable you don't need to declare it again, just assign it.

There is some kind of logic error though - startTouchPosition and currentTouchPosition will always be the same, they'll always be the location of the touch as it moves. You probably want to make startTouchPosition an instance variable and set it in touchesBegan; then you can get the distance from the start of the touch to the current position, right?

Now that you have your array of stopped blocks, you should be able to use the same trick for your jumping guy. Compute his next position, then see if his new position frame touches a stopped block.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Online Users: 293
15 members and 278 guests
ADY, aikhan, astalavista, chemistry, chits12345, dcool, Joseph Nardone, leahov, mer10, NSeven, padsoftware, Paul10, pavanindira, Promo Dispenser, RoryHarvey
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,219
Posts: 380,705
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

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