Random enemies coming out of the screen?

Talk about making games.

Random enemies coming out of the screen?

Postby The achievement » Mon Jun 05, 2006 6:35 pm

Hi guys, is there any way i can make random(or just one actor)enemies keep coming out of the screen?
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 » Tue Jun 06, 2006 12:46 am

You can use two actors: an factory and your random actor.

In the factory actor, add a timer that will create the random actor.
You can put the factory outside the view or disable the visible state.

In the 'Create Actor' event of random actor, use a code like this:

Code: Select all
xscreen = rand(view.width);
yscreen = rand(view.height);
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