How can I know the status of the tiles on the side?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ARVA_Dev

I want to know how to detect if I have a neighboring cell or none through code, for example,

If my cell has a status of 0 and the cell adjacent to it has a value of 1, I want the cell to have a value of 1, and vice versa, if the adjacent cells have a value of 0, the central cell has a value of 0

Posdata: I am use gdscript

What is a cell and how do you represent it in code? An array of int?

Cam | 2023-02-02 10:34

:bust_in_silhouette: Reply From: exuin

Have an array of directions, like Vector2.LEFT and iterate through it, adding it to the cell’s position