Can�t set my Boolean to work right.

0 favourites
  • 5 posts
From the Asset Store
_______ Huge collection of metal fixtures ________
  • 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 :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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??

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

  • 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

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