xS89Deepx
Member
I'm making a zombie game and zombie only spawns in 4 directions, check the image below...
//here my code for zombie spawns
obj_zombie_spawner
create event -
alarm[0] = 100;
global.level = 0;
alarm[0] event -
if (instance_number(obj_zombie) < 3)
{
repeat (1 + global.level)
{
instance_create_depth(x+0,y+2560,0,obj_zombie);
instance_create_depth(x+5120,y+2560,0,obj_zombie);
instance_create_depth(x+2560,y+0,0,obj_zombie);
instance_create_depth(x+2560,y+5120,0,obj_zombie);
}
audio_play_sound(snd_levelup,0,false);
global.level += 1;
}
//Reset alarm
alarm[0] = 100;
but my question is how do i keep zombies in limits?
lets say in round 20, more than 100 zombies spawns at same time, which can slowdown and crash the game...so i only want 10 zombies in room but you have to kill 100 zombies to go to next round...just keep 10 in room, so how do i do that? HELP! ME FRIENDS
//here my code for zombie spawns
obj_zombie_spawner
create event -
alarm[0] = 100;
global.level = 0;
alarm[0] event -
if (instance_number(obj_zombie) < 3)
{
repeat (1 + global.level)
{
instance_create_depth(x+0,y+2560,0,obj_zombie);
instance_create_depth(x+5120,y+2560,0,obj_zombie);
instance_create_depth(x+2560,y+0,0,obj_zombie);
instance_create_depth(x+2560,y+5120,0,obj_zombie);
}
audio_play_sound(snd_levelup,0,false);
global.level += 1;
}
//Reset alarm
alarm[0] = 100;
but my question is how do i keep zombies in limits?
lets say in round 20, more than 100 zombies spawns at same time, which can slowdown and crash the game...so i only want 10 zombies in room but you have to kill 100 zombies to go to next round...just keep 10 in room, so how do i do that? HELP! ME FRIENDS
Last edited: