One of my largest tasks this week was to implement what I had previously designed for the heads-up display for Frog Snatchers. This took more time than I initially thought it would since this was my first time touching code in a while.
First thing I did was get all of the images set up on the canvas. Making the sprite sheet and setting those up went down without a hitch.
Next, I got acquainted with how the current, heart-based, health system worked. A lot of this code was hard for me to sift through but got the gist of it quickly. Then I got to getting the health bar to deplete at the current time and rate. I normally would do this with a slider, but decided to learn to do this with image, so that they could be changed at any time during development easily. I was pleasantly surprised to find that I was able to get that set up very quickly.
The health bar was functioning correctly at this point. It was still missing a couple of features that would make it feel better though. The first one that took me a lot longer to figure out than it should have was changing color depending of how much health you have left. Me, being a dumb idiot, could figure out why when the color was changed it also went 100% transparent. That being fixed led me to having to figure out a way to cleanly transition the bar color from green to yellow to red.
This was mostly figuring out the math of getting green to lerp completely to yellow by the halfway point of the bar and yellow to lerp all the way to red from the mid point. Health bar was good enough for what I set out to do. However, I wanted one more feature. I wanted to show how much health the player was just hit for and gradually decrease that after the main health bar had been drained. This is a system from many fighting games so that both players know how much health a combo deals. This system will be very valuable when attacks start having variance in how much they hit you for. The end result of a lot of fiddling looks very good to me, but still needs more feedback.
I was so excited to really start digging into levels this week. I added a lot more content to the game and spaced out a lot of the content that was in the demo build for players to find. The current plan for the sewers is pretty expansive. In the below diagram the shaded area are scenes that are built in engine and ready for testing.