How do I detect various arrangements of sprites (blocks)?

0 favourites
  • 5 posts
From the Asset Store
Human/Character Base Pixel Art Sprites in various poses (nearly 100 files)
  • I have a grid of sprites. Imagine squares of various colors. When they are clicked they are activated. I'd like to be able to detect various combinations of activated sprites. For example, three blue sprites in a vertical line or two green sprites next to two purple sprites.

    (Right now I have four different colors used in blocks which are different sprites.)

    How would I go about this? Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For grid the best option is always to use arrays.

    The sample picture really looks like what you describe: /tutorials/307/arrays-for-beginners/page-4

  • Thanks Alyra. I scanned over the tutorial and couldn't find what I was looking for.

    Maybe someone could offer me a little guidance. For example, say I have a grid of square sprites. Different colors = different animation frame. I would like to be able to detect four square that have been clicked on an activated when they are in a box pattern. How would I go about doing this?

    Thanks!

  • Say I have a grid of tiles that are synched to a 10x10 array. Cells (4,4),(4,5),(5,4), and (5,5) are 1's and the rest are zeroes. Do I need to set up events for all these combinations? I'm thinking there's a way to streamline this, maybe with loops?

  • Yeah, really not sure...

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