Tuesday, March 31, 2020

RPG: Hit Indication, Debug Mode, Dropping Coins

Hit Indication

When you got hit in the game, the only way you knew was from the health bar going down. But that health bar is in the corner of the screen and easy to miss. I'll eventually have sounds for getting hit, but there are plenty of situations when someone won't be able to hear the game. So I wanted something more apparent to the user that they were taking damage.

Solution I came up with turned out very nice. When you get hit, the border of the map pulses red. The harder the hit, the worse the red pulse. Multiple small hits in a short period of time will also cause the red pulse to grow larger.

I also have some lingering red shading if you're injured to give a reminder that you're not at full health.

Debug Mode

As the game get more feature rich, I've been needing to change more and more variables at runtime. The solution was a debug mode. Pressing F10 brings up a little input symbol in the corner.

I can now type commands such as "framerate" or "coins=30".

And adding more commands is very very quick. To support this, I had to add support for text boxes in my SFML windowing system. Which means I could also add the ability to drop coins on the ground!

Dropping Coins

If you click on the player's purse icon, a dialog box now appears asking how much to drop.

Type the new value and push enter and it appears as a purse bag on the ground...

Several other little improvements here and there to the game as well... slow but steady progress.

No comments:

Post a Comment