Wave enemys

T

Teodor Hristov

Guest
Hi nooby question, i have a working alarm that spawns enemys.How to change after its spawn all enemys and go for alarm 2 who spawn difrent enemys from previous.I am trying to create a level with 3 waves.

this is alarm 0

if(asteroid_number < 5)
{
instance_create_layer(random(650), -20,"rockfly", obj_rock);
asteroid_number += 1;
alarm[0] = spawn_rate;
}
 

Pyxus

Member
Hi nooby question, i have a working alarm that spawns enemys.How to change after its spawn all enemys and go for alarm 2 who spawn difrent enemys from previous.I am trying to create a level with 3 waves.

this is alarm 0

if(asteroid_number < 5)
{
instance_create_layer(random(650), -20,"rockfly", obj_rock);
asteroid_number += 1;
alarm[0] = spawn_rate;
}
you could make a variable "wave" and set it to 0 in the create event. Then instead of alarm[0] you do alarm[wave]. And after you set the alarm[wave] = spawn_rate you can do wave++. Of course this would be done indefinitely so you're going to want to add to your if statement something like: if (asteroid_number < 5 && wave <= 5).
 
T

Teodor Hristov

Guest
I made this 1 wave spawns but second its not.

if alarm[wave] > 0
{
//alarm[wave] -= 1;
alarm[wave] -= 1;
if alarm[wave] = 5
{
instance_create_layer(random(650), -20,"spawner", obj_enemys)
wave += 1;
alarm[wave] = spawn_rate;
}
}

if alarm[wave] = 0
{
alarm[wave1] -= 1;
if alarm[wave1] = 5
{
instance_create_layer(random(650), -20,"spawner", obj_enemys1)
wave1 += 1;
alarm[wave1] = spawn_rate1;
}
}
 
Top