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-26-2009, 05:58 PM   #11 (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 if i already have a array of enemies do i need another one?
No, I didn't know you already had an array - I thought you needed the code.

Quote:
My array of enemies contains uiimageview of a enemy that i added to the array when the game starts and i have a timer to move the enemy, a timer to call spawnenemy method and a timer to keep score...
You probably only need one timer, calling method like "gameUpdate" - that method could call the other methods that move, spawn, and score. Otherwise you may find your operations happening in the wrong order.


Quote:
And i need to spawn enemies randomly in the x axe (i only need one type of enemy that i have added to the array)... how can this be done??
If you have the code to spawn enemies, you just need to use a random number for the x position. Like this:
Code:
int randomX = arc4random() % 320; // number from 0 to 319

newEnemy.center = CGPointMake( randomX, 150);
Quote:
And how can i increase a timers intervals in a void?? that is being called some time.....

Thanks for all current replies and future...
I don't understand this question, can you rephrase it? I don't know what "in a void" means.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,739
Threads: 89,195
Posts: 380,542
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Realtor Email List
Powered by vBadvanced CMPS v3.1.0

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