How do I Compare Vars in an Action

0 favourites
  • 2 posts
From the Asset Store
11 loops of RPG, chiptune/8-bit music. Suitable for any pixel art game.
  • Hi guys.

    I have this Event

    I have two Global Variables:LEVEL,HIGHSCORE

    how i can make that comparison as an ACTION?

    When i try to set an Action i cant see the "Compare Variable" you can see in the pic, i can do it but in a Event level...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think you can use the operators:

    =, <>, <, <=, >, >=, & (and), | (or) in expressions, for exemple:

    Set local key: "SavedSkore" to (LEVEL > HIGHSCORE ? HIGHSCORE : "0").

    Will set the local key "SavedSkore" to HIGHSCORE if LEVEL is superior to HIGHSCORE, else, it will set it to 0 (it is just an exemple)

    you could also use a function, have the comparison done inside the function, and return a different value depending on the value ( function.Call() will execute a function, and return it's return value)

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