Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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?
Develop games in your browser. Powerful, performant & highly capable.
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
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.