random enemies?

Talk about making games.

random enemies?

Postby The achievement » Sat Apr 08, 2006 5:34 pm

How can i make just random enemies fall from the screen randomly? i know this is possible. how do i do it? now i thik i use the rand() event
User avatar
The achievement
 
Posts: 220
Joined: Sun Feb 12, 2006 11:01 pm
Location: United States,Massachusetts
Score: 0 Give a positive score

Postby makslane » Sun Apr 09, 2006 2:45 pm

In the 'Create Actor' event of your enemy, put this code:

xscreen = rand(view.width); //random x position
yvelocity = 5; //make the anemy fall

Now, in some other actor, just create the enemies (may be in a timer)
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest