Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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:09 PM   #12 (permalink)
LeopardDevX
iPhone Developer
 
Join Date: Mar 2009
Posts: 219
Arrow ok..

Quote:
Originally Posted by smasher View Post
No, I didn't know you already had an array - I thought you needed the code.



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.




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);


I don't understand this question, can you rephrase it? I don't know what "in a void" means.


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....
__________________
Thank You.
LeopardDevX is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,176
Threads: 38,949
Posts: 170,875
Top Poster: smasher (2,565)
Welcome to our newest member, palmerc
Powered by vBadvanced CMPS v3.1.0

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