Change frame animation depending on neighbor

  • How can I make a tile to change his animation depending on his neighbor?

    For example:

    If I have 3 blocks like this:

    [1][1][1]

    Where [1] represents center frame of a tile

    And I want the blocks to automatically change to:

    [2][1][3]

    Where [2] represents left frame of a tile, and [3] right frame.

    Another example would be

    [1][1][1][1][1]

    To:

    [2][1][1][1][3]

    So it would be something like "If doesn't have neighbor at right, change frame to 3" and "If doesn't have neighbor at left change frame to 2"

    But I've no how to do that in C2.

    Anyone can help me please?

  • I would like to know how to do this too - the only way I've worked out is really stupid and involves setting everything to have platform behaviour and then using the "has wall to left/right" conditions like this. But it doesn't seem like a good way to build things and I bet having a platform behaviour on everything will slow the game down.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's a way to do it,

    but as you said having 1000 or more blocks with platform behaviour for sure would make the game slow down.

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