Variable comparison

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi All,

    I have a family of sprites with a local variable "colour". I wanted to compare this variable, so I'm currently using system condition "compare two variable", which is working well.

    So my current event looks like this:

    sprite.colour = sprite.colour

        -> (sub event) enter while loop.

    But now I to add a check against two specific colours in the family. Can anyone tell me how I could write my event to include this.

    So something like this:

    sprite.colour = sprite.colour

    OR

    sprite.colour = "blue" & sprite.colour = "green"

        -> (sub event) enter while loop.

    Thanks in advance for any advice you can offer.

  • Does anyone know if this is possible. I've looked through the conditions but can't seem to find anything useful.

    I want to write something like this:

    sprite.colour = sprite.colour

    OR

    sprite.colour = "blue" & sprite.colour = "green"

        -> (sub event) enter while loop.

    Any ideas, thanks.

  • Sounds like you would like to do something kinda like this.

    Instead of trapping the health variable, you'd want to trap the colour variable into the local variables and test.

    Once I get some sleep, I'll write up a full tutorial on this, since it seems to be something that's been coming up a lot.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks so much theubie, your a star!

    I'll take a look at your link, and if I don't have any luck figuring it out myself, I'll keep an eye open for your tutorial.

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