Healing, Game Over and Random Rooms
Four days of development has resulted in a game that generates infinite random content! Beat stages, die, start over. The core experience is working and it feels great.
All enemies can now drop health for the player. The result?
It’s possible to do well and not die! Health will need to be made more scarce when I get around to drop frequency, but it’s still fun to see how much impact a single new game mechanic has.
Using the existing ability to show title cards for stages, I added a “Game Over” title card in red. I also added a delay before the next game starts so that the player can mourn their losses for a moment.
I tried so many techniques for making rooms:
- Generated completely in code by transforming walls.
- Prefabs for each room type with a naming system for layout.
- One prefab with doors and walls that can be toggled in code.
The solution that won was the single prefab with toggles. It’s very logical and can layout any grid of rooms I want. So far, I’m only laying out two rooms randomly, but I know more are just within reach.
Here’s the code that powers the modular prefab room: