Healing, Game Over and Random Rooms

Four days of code and the game feels so much different. I love the feeling of my velocity increasing.

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.

Healing

All enemies can now drop health for the player. The result?

At some point it will make sense to work on making the UI readable. Not yet.

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.

Game Over

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.

Random Rooms

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:

Time Lapse

GIF and PNG Grab Bag

It took me forever to figure out why this was happening: two walls on top of each other nullify bouncing. | Getting room generation right took generating a lot of impossible to traverse rooms.

Up Next

Very excited for the animation between levels. I’ve always enjoyed fanfare when beating something in a game.

Today’s post was brought to you by the hash, a0b338.

< Previous Post | Next Post >