i i have two variables hp and max hp (10/100)
and when i click on 'rest' button hp should increase about 15% of maxhp
how do this?
You want something like
Set instance variable hp:
((maxhp * 0.15) + hp) > maxhp ? maxhp : (maxhp * 0.15) + hp
In human words, if 15% of maxhp + hp is grater than maxhp
set hp to maxhp
else set hp to 15% of maxhp + hp
Egozi i know what i must do when hp is less than 0 and more than maxhp -> set hp to maxhp and i receive 100/100
I have to translate into construct2
Develop games in your browser. Powerful, performant & highly capable.
Ashley can you add a simple expression 'add x% of variable to other variable' ?
No, it should be easy already, just multiply it by 1.15 to add 15% for example.