Search Array with certain characteristics

1
Hello, I'm developing a very basic game with Javascript, but I came across a little something that I could not solve until now, the question would be, I have an Array, in which I randomly include 28 objects, and those objects have a position < strong and and color , which are also randomly determined by filling this Array, they are displayed through the < canvas & gt ; , what I would be trying to do, would be, verify that the elements are aligned on the screen (in groups of 3 or more) and remove them from the main Array, as the positions are determined randomly, elements may be being displayed in the order in which they are stored in the Array or not

Ex:

Thegreencubesintheimagefollowthepattern,typeinthoseoldgames,Ihavea"demo" in the CodePen , I hope have been able to explain

    
asked by anonymous 07.06.2017 / 07:21

0 answers