PDA

View Full Version : [AS2] Spawn Help!


Lorithon
06-29-2009, 02:32 PM
Hey guys i was wondering if you could help me solve this problem


i have a code which spawns enemies at a symbol called spawn1

the question is how do i make my enemies spawn at 2 or more random locations


as in two specific locations

in this case the two locations being the location of "spawn1" or "spawn2"

i need this because i want the zombies to come from 2 seperate doors

Please help i've looked everywhere and surprisingly there are no tutorials on this that i can find.

rrh
06-29-2009, 03:46 PM
var frank:Number = Math.random();
if (frank<0.5) {
//spawn from one door
} else {
//spawn from the other door
}