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

Get help using Construct 2

Post » Tue May 13, 2014 8:01 am

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...

Image
B
47
S
14
G
20
Posts: 87
Reputation: 12,913

Post » Tue May 13, 2014 2:38 pm

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).
B
43
S
12
G
6
Posts: 446
Reputation: 6,807

Post » Tue May 13, 2014 10:29 pm

Message: LaroTaio is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Sargas wrote:
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 :D

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.
B
47
S
14
G
20
Posts: 87
Reputation: 12,913


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests