Artifact : Energy
|
This time I’ve been working on the Energy artifact, or rather linking it together with previous artifacts such as the Slider bar and the GUI. This is also not visible until you get to the second stage of the game where you grow up and acquire your fishing rod. Its only drawn with color in the second state where you actually have an energy bar. And as the describing color of the bar is white it will reveal itself as soon as the bar changes color in the background, quite simple but well thought out.
The Energy slider is actually being drawn in secret in first stage of the player fish, but is then always set to 100% and white, in order to cover up the transparent hole where the bar in the stage where you get the energy is. It also has a text in front of it with the same color, so having it being drawn behind nicely shows the text when changing the color of the bar upon finding the fishing rod. By doing this there is no need for changing the sprite of the GUI upon reaching the next stage of the game. By using the previously used Slider, that is also used for Volume controls and the hunger bar. I added one to show the energy on a scale 0 – 100, each number being 1 % of the bars width. The energy also has power ups that you can find in the terrain. These power ups modify how fast the energy is drawn, With each upgrade the drain is lowered. These powerups made it abit more difficult to figure out how to balance the energy drain, while being a simple question on math, it turned out as a formula where the powerupcounter being 0-3 being multiplied with the energy. Looking like this : m_Energy = m_Energy – (1 – (.3 * m_PowerupEnergyCounter )); The GUI also shows the upgrade status by filling in 1/3 of each circle representing each upgrade.
The Energy bar is placed in the GUI to give the player a visual representation of the current energy status. This lets the player know when the power is about to run out and the light will go dark. The energy itself is also there to prevent the player from always having the light on, and give the player the option of when to use it and when to turn it off. though draining the energy out completely will automaticly turn the light off, leaving the player in darkness. |

