There are a few issues with implementing the player death animation.
Make the player show a death animation when their health passes below zero.
Affects:
game_congtroller.gd
player.gd
scene_manager.gd
For a simpler implementation, use a timer to delay reloading the scene when the player dies.
There are a few issues with implementing the player death animation.
Make the player show a death animation when their health passes below zero.
Affects:
- game_congtroller.gd
- player.gd
- scene_manager.gd
For a simpler implementation, use a timer to delay reloading the scene when the player dies.
In the game_controller, check to see if the player's health is over zero before attempting to decrease the health. We should stop decreasing it if the player is already in the dying state.
In the scene_manager, only attempt to start the timer if it is not already running! If timer.start is called it resets the timer. This is a problem when the slime keeps hitting the player (who is down).
In the player script, create a simple boolean to track if the player is alive. If the player is NOT alive, everything (controls, shooting, moving, etc.) should all be disabled. This prevents the player from taking action while the dying animation happens.
In the game_controller, check to see if the player's health is over zero before attempting to decrease the health. We should stop decreasing it if the player is already in the dying state.
In the scene_manager, only attempt to start the timer if it is not already running! If timer.start is called it resets the timer. This is a problem when the slime keeps hitting the player (who is down).
In the player script, create a simple boolean to track if the player is alive. If the player is NOT alive, everything (controls, shooting, moving, etc.) should all be disabled. This prevents the player from taking action while the dying animation happens.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
There are a few issues with implementing the player death animation.
Make the player show a death animation when their health passes below zero.
Affects:
For a simpler implementation, use a timer to delay reloading the scene when the player dies.
In the game_controller, check to see if the player's health is over zero before attempting to decrease the health. We should stop decreasing it if the player is already in the dying state.
In the scene_manager, only attempt to start the timer if it is not already running! If timer.start is called it resets the timer. This is a problem when the slime keeps hitting the player (who is down).
In the player script, create a simple boolean to track if the player is alive. If the player is NOT alive, everything (controls, shooting, moving, etc.) should all be disabled. This prevents the player from taking action while the dying animation happens.