Help with an expression

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hey all,

    I'm having trouble with an expression that picks different instances of the same sprite. Basically the expression looks something like:

    If TileSprite is Illuminated (boolean)

    And Tilesprite is overlapping Tilesprite at offset (0,16) or (16,0) or (-16,0) etc - covering the 9 tiles surrounding the original Tilesprite

    Then

    Set Tilesprite boolean Illuminated to True

    In other words, starting with the first Tilesprite that is Illuminated, the boolean value Illuminated "radiates" out to all surrounding Tilesprites (and then on to the ones surrounding them, etc). The problem is I don't think Construct is picking the right Tilesprite to set the boolean: the condition mentions multiple instances of Tilesprite, but I think the action is only picking the primary instance (which already had the Illuminated value!).

    I hope I've explained that well enough! I'm sure it's just a case of me not expressing it properly, could anyone please tell me how to achieve this effect?

  • To simplify this question, I guess I'm really asking how to tell Construct this:

    If Tilesprite with ValueX is overlapping TileSprite without ValueX, set second Tilesprite to ValueX

  • You can't reference two of the same object at the same time. You can do this with Families, or you could have an invisible helper sprite that you place over the illuminated one, then do your comparison against the TileSprites.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm, I didn't know that. Thanks, I'll try it with families.

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