So here's what I have.
I am trying to get my game to randomly pick a x and y coordinate on the screen displayed (which it does)
Then randomly select 1 of 3 monsters I have created and spawn it.
All of my monsters are off screen due north and have a lock code on them that prevents them from MoveTo(ing) the main player. Until they are spawned then that's when they MoveTo.
- Code: Select all
montemp = 0; //creating my switch
if(montemp = 0){
montemp = rand(3); //switch started
timer1++;
if(montemp == 1){ //spawn monster1 if montemp is equal to 1
if (timer1 == 40)
{
CreateActor("monster1", "mon1walkfront1_seq", "(none)", "(none)", rand(320), rand(240), false);
CreateActor("monster1", "mon1walkfront1_seq", "(none)", "(none)", rand(-320), rand(-240), false);
timer1 = 0;
}
montemp = 0;
}
}
if(montemp == 2){
if (timer1 == 100){
CreateActor("monster2", "mon2walkfront1", "(none)", "(none)", rand(320), rand(240), false);
CreateActor("monster2", "mon2walkfront1", "(none)", "(none)", rand(-320), rand(-240), false);
timer1 = 0;
}
montemp = 0;
}
if(montemp == 3){
if (timer1 == 200){
CreateActor("monster3", "mon3walkfront1_seq", "(none)", "(none)", rand(320), rand(240), false);
CreateActor("monster3", "mon3walkfront1_seq", "(none)", "(none)", rand(-320), rand(-240), false);
timer1 = 0;
}
montemp = 0;
}
}
It's quite a lot. The code works when I specifically set the montemp to 1 (and it spawns monster1) and erase all the other junk, but I cannot get it to work with everything else.
Help anyone?
