Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

how’d you make the health?

(+1)

I use a global variable to track the health. It gets set to 10 on scene init, and then gets decremented whenever the player gets hit. The indicator is a sprite consisting of 10 frames, numerals 0-9 except the 0 is replaced by 10 to save space. When the health changes, the sprite's frame is set to the value of the health variable. If the health is zero, then the game over is triggered.