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

Get help using Construct 2

Post » Mon Mar 10, 2014 6:03 pm

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!
B
10
S
4
G
3
Posts: 103
Reputation: 2,984

Post » Mon Mar 10, 2014 10:13 pm

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

:D
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Mon Mar 17, 2014 12:45 am

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!
B
10
S
4
G
3
Posts: 103
Reputation: 2,984

Post » Tue Mar 18, 2014 5:30 am

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?
B
10
S
4
G
3
Posts: 103
Reputation: 2,984

Post » Wed Mar 19, 2014 4:27 am

Yeah, really not sure...
B
10
S
4
G
3
Posts: 103
Reputation: 2,984


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 56 guests