KyleRansford
Member
I'm trying to make an animation play after the player's HP runs out and before the player restarts the level. But even though I have an alarm set, the player restarts right after the HP runs out, not giving the animation time to play and bypassing the alarm. Here is the code I'm using. Is there something I'm missing? My game is set at 60 FPS so, I've set it for about 4 seconds to wait for. By the way, "s_player_game_over" is the animation that's supposed to play. Not the game over screen.
Code:
if global.player_HP <= 0 && !invincible_ && global.player_lives >= 0 {
create_animation_effect(s_player_game_over, x, y, 10, true);
alarm[3] = 240;
instance_destroy();
global.player_lives -= 1;
ini_load("save_data.ini");
}