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, 04: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: 2,570
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.
__________________
smasher is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 282
22 members and 260 guests
aderrington, Alexman, AlexTheMighty, arcturus, Bertrand21, Cathy, Chilibird, Corund, evana, Falcon80, fanstarmike, Glnn, headkaze, jhaynie, kalygraphix, mac514, pereorra, shuvo1879, Slecorne, smrtital, Stan Edge, tlikyu
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,228
Threads: 39,007
Posts: 171,098
Top Poster: smasher (2,570)
Welcome to our newest member, SSL Matrix
Powered by vBadvanced CMPS v3.1.0

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