Detecting adjacent table values

Spalding004Spalding004 Member, BASIC Posts: 89
edited March 2015 in Working with GS (Mac)

I'm working on a game where the player matches tiles which are dropped from the top of the screen.

The tiles are all tracked by by a table, which records the internal ID of the tile itself (an integer between -1 and 10) in its correct position. I can make it so that tiles are detected when they are in a line (horz and vert) but I cannot for the life of me figure out a solution where the target number (let's say, at least 5) is detectable in any other configuration.

Each tile rests on a "frame" actor which reacts to the game by changing color, etc, and is also tied to the same table values as the tiles above. Is there a (resource-friendly) way I could use those actors to check my table for correct solutions? Or any other way to achieve my goal?

Ex:

:) :) :) :) :)
<3 <3 <3 <3 <3 <------ This works.
:) :) :) :) :)


:) :) :) <3 :)
<3 <3 <3 <3 :) <------ This does not.
:) :) :) :) :)

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    So you're wanting to detect 5 identical values that "touch" anywhere in a table? I could be wrong but I think you'd have to use a path finding algorithm to do that.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Spalding004Spalding004 Member, BASIC Posts: 89

    That's what I was afraid of. Oh well! Thanks for that confirmation.

Sign In or Register to comment.