- Home /
Code for gridColour[x,y] == gridColour[x+1,y] || colour at [x-1,y] || colour at [x,y+1] ||colour at [x, y-1] to detect if 4 of the same colours are connected?
Please help I've been trying to work this out for a few days
How do you write code like this screen shot to detect that all of these tetrominos (within its parent game object) have 4 of the same colour tetromino connected? colour tag at [x,y] == colour tag at [x+1, y] || colour tag at [x-1,y] || colour tag at [x,y+1] ||colour tag at [x, y-1] ?
My game is similar to this screen shot, but it has 2 random colour tetrominos within a parent game object, each tetromino is tagged "red" or "blue".. I want to detect once 4 or more of those same colour tetrominos tags are connected those tetrominos destroy and the grid is updated..
Your answer
Follow this Question
Related Questions
How do you find adjacent tiles of the same type in grid array [x,y].type == [x+1,y].type 0 Answers
How to only show objects in range ? 2 Answers
[c#] Create visible appearence of a grid using texture or models 1 Answer
The 'correct' way to deal with animations in a grid-based game? 1 Answer
Find objects by one tag or another. 3 Answers