wrestitaway
Member
Trying to use an alarm to do so, but it isn't working out.
I have a boss _1 object that handles the level one boss, and boss_control that handles all bosses extrances and exits (or will when I get that far). I also have a global variable and a set of enums that switch their states.
BOSS_CONTROL
create:
step:
alarm[0]:
draw:
and in my boss:
draw GUI:
After the boss dies, there's an explosion. That works. I'm not sure what I'm doing wrong afterwards, though. I wanted to set the alarm at the same as time as the boss destroys itself and after 3 seconds tile a black sprite across the room and throw up a "Room Cleared" text and moved to the next room (not there yet, obvisiously).
What am I doing wrong?
Any help appreciated. Thanks.
I have a boss _1 object that handles the level one boss, and boss_control that handles all bosses extrances and exits (or will when I get that far). I also have a global variable and a set of enums that switch their states.
BOSS_CONTROL
create:
GML:
enum states
{ walk,
idle,
jump,
attack,
falling,
blocking,
summon,
death
}
global.state = states.walk;
///////boss room end
global.boss_destroyed = false;
black_screen = false;
GML:
/////boss destroyed
if global.boss_destroyed == true
{alarm[0] = room_speed * 3}
GML:
black_screen = true;
GML:
if black_screen == true
{draw_sprite_tiled(sp_blankscreen,0,0,0);}
GML:
if bs_1_hp <=0 {
global.state = states.death;
global.bs_death_x = ob_boss_1.x
global.bs_death_y = ob_boss_1.y
global.boss_destroyed = true;
instance_destroy()
instance_create_layer(global.bs_death_x,global.bs_death_y,"lyr_inst",ob_poof)
}
GML:
randomize()
if global.state = states.death
{ repeat (6) {
draw_sprite(sp_poof,0, global.boss_death_x + irandom(sprite_width),global.boss_death_y + irandom(sprite_height));
} }
What am I doing wrong?
Any help appreciated. Thanks.