When the player is unable to play (dies)
we trigger a game over state.
By calling a custom function in our
Add this code to the bottom of your Player Script
Check for Game Over by FALLING
Check if your player is under the terrain.
Drag your player the lowest position they can reach under your world.
Check the Y position and use it in your code.
Add an if statement to the _physics_process function.
This checks the player’s Y position and if it is greater than your chosen value
Change the background colour of the map
Go to Project Settings --> Environment --> Change Default Clear Colour