Star Child Dev Log #29
Jay Ingle - lead developer, designer, and artist:
What happens when you die? I don't know, hasn't happened to me yet.
However, I have died in plenty of video games. What happens when you die in a video game? Dark Souls says "YOU DIED" and lets you press a button to continue immediately. Symphony of the Night makes you wait a long time, plays an unskippable cinematic, then takes you back to the memory card screen, and then lets you slowly load your saved game. My first game Toleo says "UNFULFILLED" and does nothing else, it just waits for you to press the respawn button. A lot of retro games just fade out back to the main menu.
So what do we want to happen in Star Child? So far, I've had nothing set up. Well that's not true, I put a 5 second countdown screen with the game over text from Friday the 13th NES, which then booted you to the main menu, and greatly annoyed my playtesters. That joke was dead very quickly, so then I set it to autoload the last save game, a few seconds after dying in the game. Now I've finally set up a proper Game Over/You Died screen overlay. Complete with placeholder font and button.

Let us look at the simple way we make this happen. First we set up the nodes we will need, adding them to our HUD scene.

We need a ColorRect, which is set to be a black square that covers the screen, starts invisible, and is faded in, to dim the screen. Very important: we have to go into the inspector for the ColorRect, then change Mouse mode to Ignore:

It defaults to Stop, which means that, even when invisible, this ColorRect will be in front of everything else, and you would not be able to click on anything behind it. This can be quite a tough bug to diagnose, but thankfully the Godot debugger has a very helpful Misc section which shows the last Control element that has been clicked on.

We also need an animation player, a label to display our You Died type message, and a button to continue the game. Let's take a look at our animation track.

The top track causes the screen to dim by fading-in the black square ColorRect. The next track fades-in the You Died message, a little delayed so the dimmed starts first. The next track keeps the button invisible, until it blinks into visibility near the end. And at the same time, the final track calls a method that enables the button and grabs focus.
So, when the player dies, it starts a death timer. When this death timer times-out, it sends a signal that calls the game_over() function. This function just starts the game_over animation, which handles everything else. Note: I added enabling the button, in the top function, after taking this screenshot. And finally, the bottom function is a signal connected to the Continue button, which loads your previous save game.

This is all pretty simple to implement thanks to the power of Godot's animation player. But there is still one question: Why "Failure"? Failure presumes that you are trying to accomplish something, and you have failed. What is Star Child trying to accomplish? You must play to find out!
What happens when you die? I don't know, hasn't happened to me yet.
However, I have died in plenty of video games. What happens when you die in a video game? Dark Souls says "YOU DIED" and lets you press a button to continue immediately. Symphony of the Night makes you wait a long time, plays an unskippable cinematic, then takes you back to the memory card screen, and then lets you slowly load your saved game. My first game Toleo says "UNFULFILLED" and does nothing else, it just waits for you to press the respawn button. A lot of retro games just fade out back to the main menu.
So what do we want to happen in Star Child? So far, I've had nothing set up. Well that's not true, I put a 5 second countdown screen with the game over text from Friday the 13th NES, which then booted you to the main menu, and greatly annoyed my playtesters. That joke was dead very quickly, so then I set it to autoload the last save game, a few seconds after dying in the game. Now I've finally set up a proper Game Over/You Died screen overlay. Complete with placeholder font and button.

Let us look at the simple way we make this happen. First we set up the nodes we will need, adding them to our HUD scene.

We need a ColorRect, which is set to be a black square that covers the screen, starts invisible, and is faded in, to dim the screen. Very important: we have to go into the inspector for the ColorRect, then change Mouse mode to Ignore:

It defaults to Stop, which means that, even when invisible, this ColorRect will be in front of everything else, and you would not be able to click on anything behind it. This can be quite a tough bug to diagnose, but thankfully the Godot debugger has a very helpful Misc section which shows the last Control element that has been clicked on.

We also need an animation player, a label to display our You Died type message, and a button to continue the game. Let's take a look at our animation track.

The top track causes the screen to dim by fading-in the black square ColorRect. The next track fades-in the You Died message, a little delayed so the dimmed starts first. The next track keeps the button invisible, until it blinks into visibility near the end. And at the same time, the final track calls a method that enables the button and grabs focus.
So, when the player dies, it starts a death timer. When this death timer times-out, it sends a signal that calls the game_over() function. This function just starts the game_over animation, which handles everything else. Note: I added enabling the button, in the top function, after taking this screenshot. And finally, the bottom function is a signal connected to the Continue button, which loads your previous save game.

This is all pretty simple to implement thanks to the power of Godot's animation player. But there is still one question: Why "Failure"? Failure presumes that you are trying to accomplish something, and you have failed. What is Star Child trying to accomplish? You must play to find out!