Canít set my Boolean to work right.

Get help using Construct 2

Post » Thu Nov 10, 2011 1:08 pm

I have these crystals to catch, and in the end if the player gets them all, they will send him to a bonus round.

So I set in the HUD the image of each one, set to 25 opacity. So each time the player gets one, the firsts getís 100% opacity, continuously until the last.

The problemís the only one to work is the first one, the others I canít make them to work as well as the first.

I could clone the others and set a different event based on a global variable, but arenít the Booleans supposed to ease up this kind of system?
Or I am totally wrong (which a HUGE possibility lol).

What's the better way to this?

Hereís the Capx of what Iíve done.

http://dl.dropbox.com/u/1056957/Boolean.capx

Thanks :)
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Thu Nov 10, 2011 2:02 pm

Fixed

You don't need boolean in that case. Simply a global.

Also I toggled a line in the action list, since the way you setted your actions, this one is useless. You add 1 to a value, and later set the value to something.
This is probably not what you wanted to do.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Thu Nov 10, 2011 2:46 pm

No, this is exactly what I wanted.
I was thinking of cloning the sprites for each time I inserted a diamond, and it would have sucked of doing.

Tell me one thing by curiosity.
Why currGemin? Curr is somekind of expression that means Ďcurrent spriteí?
B
18
S
4
G
5
Posts: 149
Reputation: 4,498

Post » Thu Nov 10, 2011 6:05 pm

curr for Current yes, but this is strictly a personnal convention so I remember what I use this variable for.

Also I don't understand why you would have one bogus action that is useless in a stack of actions.
For this little example, it's no big deal, but if you take the habit of having useless actions polluting your code, you might end up using more CPU than required on a full project.Kyatric2011-11-10 18:07:24
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Thu Nov 10, 2011 6:14 pm

You're right, I was just trying this and that, to see if or how it works. It was trial & error phase.

Once I see how it's done I errase those :)

thanks
B
18
S
4
G
5
Posts: 149
Reputation: 4,498


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests