:
also there's a option for grid_snapped(-,-) which is an if variable but I'll find away to make the player snap to the grid.
|
It's been a while since I've worked in GM, but here's the equivalent of something I used the other day when I was arsing around with LWJGL.
Put this in End Step, otherwise it won't work.
:
this.x += dx;
if (x % GRID_SIZE == 0) {dx = 0;}
Then just set dx in keyboard events. While the object's x isn't a multiple of your grid value it will keep moving in that direction. It should be faster than the GM function, especially if you don't need a vertical grid.