DrakeStoel wrote:Ok, so is that ALL the 4s are changed to 2s?
Right.
DrakeStoel wrote: And I'm not quite clear on how to add or subtract hearts
skydereign wrote:Now you'll need to prevent hp from ever increasing beyond the max (full_hearts*4), as well as make sure the hearts won't display if they aren't yet obtained. But that should be just a matter of putting in an if statement to set the transp or visibility state.
Essentially create them all at the beginning, and don't display the ones that the player hasn't gotten.
DrakeStoel wrote: and what division you were talking about
I mentioned division because I assumed you wanted to know how it works, and by dividing hp-1 by the max each heart can hold (2 hp), the game can know if the heart is the one that needs to have a fractional heart.
DrakeStoel wrote:or really how to get the hp value to drop properly
Do you know how to use variables? If so, that is all it takes. Increase and decrease it as you would a normal variable. The only thing to watch out for is never increase it over the max hp value, and you shouldn't decrease it beyond zero.
To make this easier, here is a small example of it. Up and down increases and decreases the max hp (number of hearts). Left and right increases/decreases hp by one. Space will set hp to the current max.