Player Death Animation #6
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.