Quote:
Originally Posted by LeopardDevX
I`m really sorry for dum questions...
,but by "in a void" i mean in a method...
And i dont have the code to spawn a enemy..
Thanks for the arc for random code i will use that.. when i know how to spawn enemies.....
And what is the newEnemy is that reffered to "spawnedEnemy" or what is it for?
Thanks...
Sorry im a newb....
And you have helped me alot....  
|
No problem. You usually start the timer once, with an interval like 30 times a second. It's unusual to change the timer interval during the games.
Code:
timer = [NSTimer scheduledTimerWithTimeInterval: 0.033f
target: self
selector: @selector(handleTimer:)
userInfo: nil
repeats: YES];
If you want to change the interval later, you have to call [timer invalidate] and create a new timer. You should probably good for a timer example to get all the code for starting/stopping a timer.
The code I gave above spawns 10 balls on the screen - you could use it to spawn enemies too.