How do I add a ever 1to variable add 0.0227

0 favourites
  • 2 posts
From the Asset Store
Kids Game
$24.50 USD
50% off
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • Basically I'm trying to do a hp bar that works via 2 variables. A Player Health and a Player Max Health. Instead of lots of

    If Player Health = 1 then +0.0227

    If Player Health = 2 then +0.0277

    If Player Health = 3 then +0.0277

    Etc

    I want to find a more possible way of doing it so

    Every 1 to Player Health Add 0.0277 to Player Max Health

    For context of the variables the Health is the Player Health that's takes damage and the max is obviously the max Health however because I'm using a progress bar tween to a Sprites width adding max Health means the bar goes off screen so after doing some calculating every tick it checks that global variable and divides the tween by 0.0227 every time.

    Any help of some sort of condition or something else would be greatly appreciated.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I thought if add I tested using on J and K keys pressed it adds 10 to max and 0.277 to the max Health global so it works I just need to find a way it almost auto does it so can add things like Armor Health increase and buffs/debuffs spells etc.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)