Help with connect 4 detection

How to check the win condition in connect 4

I want to see when a player has 4 in a row, either horizontally, vertically, or diagonally.
Currently I have The position of each piece in the board stored in an instance variable for each object, eg: row 3, column 5.

I have done this before in a python project a long time ago, and I remember using arrays or lists, but as far as I know the Gdevelop functionality is different.

Any help much appreciated.

1 Like

Really interested to see what solutions people can give for this.

Nevermind, I solved it. I just create checker objects at token.X()+64somevariable and repeat that four or more times depending on the amount of tokens in a row you are trying to find. I then repeat this process 8 times while changing the + or - '64somevariable’ on the x and y axis to get diagonals, up, down, left, right.