How do I use the width condition to add to global variables.

0 favourites
  • 3 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • How do I add a value to star global variable, using the WIDTH condition of Health Bar (Health1) instead of collision with star object?

    The width of my health bar is 300

    What I want to happen is if the width of the health bar is:

    300 add three stars to global variable

    150 to 200 add two stars to global variable

    100 to 150 add one star to global variable

    50 no star

    Any solution to this is very much appreciated.

    Thank you in advance...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:386yc5d0]Is between values (System conditions)

    Test if a number is between two values (greater or equal to a lower value and less or equal to a higher value).

  • [quote:mstsqam8]Is between values Test if a number is between two values (greater or equal to a lower value and less or equal to a higher value).

    Thanks Bratha

    Doing the health bar width condition took me about three days with no result. So after posting this question, I looked for another alternative, having not much experience with arrays, I analysed closely the sequence of the code, I'm pretty sure there is something I could play around with. So I started messing the values in the arrays, going back and forth with the 2 event sheets, testing on the preview browser, until I hit the jackpot. Finally, got it working, the solution is in the powerful arrays, also, I increased the value on start of stars, instead of adding stars on the global variable, now every-time the hero hits the poison it subtracts 1 from the global star variable as well as the width of health. Ouch! My brain still hurts.

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