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

Thread: Random Rocks
View Single Post
Old 02-15-2010, 02:11 PM   #49 (permalink)
smasher
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Quote:
Originally Posted by Sesa View Post
can anyone please help me with this Collision code: i want to make a collision between the elephant and the flakeImage, but it dosent work.
You're using beginAnimations/commitAnimations to animation an image from the top of the screen to the bottom, right? And then you're checking for collisions once, right after you start the animation.

In my experience CGRectIntersectsRect and beginAnimations/commitAnimations do not mix well. flakeImage.frame will return the endpoint of the animation, not the real current position of the flake. I would pick a reasonable framerate like 15 or 20 FPS and update the positions yourself, without using beginAnimations/commitAnimations.

I also don't see an array of flakes. CheckCollision needs to loop through the array of flakes and check each one against the elephant.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Online Users: 789
20 members and 769 guests
7twenty7, alexeir, antonwilliams, AppAnnex, Clouds, daarshg, dansparrow, haihung_kt, Hannibal2010, manop_cs, mishti, mwyld, policy1, raymng, Robiwan, shellytf96, Sophie100, Trixlean2012, upultharanga685, ziocleto
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,477
Threads: 94,040
Posts: 402,626
Top Poster: BrianSlick (7,978)
Welcome to our newest member, Trixlean2012
Powered by vBadvanced CMPS v3.1.0

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