+7 votes

3 Answers

0 votes
by
 
Best answer
snippet
+2 votes
by
compare the x and y of the square to the x and y of the wall
by
Well, as if I know what to compare BUT I do not know where to compare ...
by
Vohob Ahmad , в if .
by
Before line 82.
by
WbICHA , Captain Obviousness))
by
ProtCN , Bro na slovax legko))
by
Vohob Ahmad , compare there when you move and update the coordinates, that's before this update and need to compare to decide whether to change them or leave them (cancel, will not move into the wall)
0 votes
by
Check if the segment the square is on is active (black). If it is active, it has collided.
...