>
> > % is a symbol of modulo (reminder after division) e.g. 10%3 gives 1.
> >
> > If you want to check if player's health is more than 50% you should compare this: player.health/player.maxHealth>=0.5
> >
>
> i want to check it in % because i might have the player max health be upgradable so 100% health could go from 100 to 150 +, etc...
>
> that's why.
>
Use a global variabe for Max Health and one for Set Health that way you can change it as the game progresses.
MaxHealth=100
SetHealth=100
On Player Collision with Enemy: Subtract 10 from MaxHealth
On MaxHealth < SetHealth/2: Change HealthBar Sprite
That way you can change SetHealth later in the game to a higher number and the event adjusts. When you change SetHealth make sure you also set MaxHealth to that same number to start.
i kinda got it to work on my own, but there is a problem, ive put the flash behavior on my tiled background but it doesn't flash when it should be =/