I have a project and I got into a problem. The project would be a simple simcity 1 done in pure javascript. The problem is that when making crosses and curves I can not detect the next square on my grid. To learn how to solve the problem I wanted you to do the following: If I put a square the square to the left turns green, the right turns yellow, the above turns blue, the below brown and explain how it did if possible. My idea was to click to draw my square and draw 8 others around it to see if it has a square next to it.
Linktothecode: link