How do I Make a weapon comparison bars?

Get help using Construct 2

Post » Sun Jun 12, 2016 6:47 am

I know how to make a bars with the values etc, but I'm not sure how to approach this.
Having the green when the compared value is greater and red when the compared value is less then. :oops:

Image

Thanks in advance.
B
22
S
12
G
19
Posts: 54
Reputation: 11,554

Post » Sun Jun 12, 2016 10:08 am

You could make 3 bars for each statistic... one white (for the current weapon) and one red and one green.

You would then need to store the stats for the weapon you're comparing with in a set of variables (global or local would probably do) then do some comparisons.

The white bar would always be shown on top, with the red or green being underneath - visibility of each bar based on the comparisons;

Example pseudo code:
Compare -> WeaponVariable.RateofFire is less than Weapon2Variable.RateofFire -> GreenBar = invisisble, RedBar = visible
Every tick -> Set WhiteBar.value to WeaponVariable.RateofFire
Every tick -> Set RedBar.Value to Weapon2Variable.RateofFire

There's always a million ways to do stuff, but this should work

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests