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, 06:09 PM   #12 (permalink)
LeopardDevX
iPhone Developer
 
Join Date: Mar 2009
Posts: 222
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
 

» Advertisements
» Online Users: 618
18 members and 600 guests
ADY, Dattee, denied, Duncan C, iDifferent, john love, kapps11, klrichner, mapiko, mongoose250, mylogon, peppinoss, Punkjumper, Robiwan, sle39lvr, smithdale87, Speed, timle8n1
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,745
Threads: 89,201
Posts: 380,564
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Ashleyk27
Powered by vBadvanced CMPS v3.1.0

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