if you work on a grid game not only your mines must be in the grid,
also your diver / snake /… must move in grid steps and not in float or int pix.
so you can divide the pix position by the grid cell width ? use also floor() ?
to determine what grid cell you are in
1 Like