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 03-27-2009, 05:00 PM   #18 (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

Quote:
Originally Posted by LeopardDevX View Post
But.....

I cant get the newEnemy to move after its spawned.....

So how??

Thank you so much it all makes perfect sense to me now...
You probably have a moveEnemy method that is called every frame? That method now needs to look through the array of enemies, and move them all. That's what the array is for. This will loop through every enemy in the array, and move each one down and to the right:

Quote:
for (UIView *anEnemy in enemies){
int newX = anEnemy.center.x +5;
int newY = anEnemy.center.y +5;
anEnemy.center = CGPointMake(newX, newY);
}
__________________

Free Games!

Last edited by smasher; 03-27-2009 at 09:34 PM.
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,738
Threads: 89,194
Posts: 380,540
Top Poster: BrianSlick (7,129)
Welcome to our newest member, chrisedjohn
Powered by vBadvanced CMPS v3.1.0

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