Anyone know how to combine this code to also take into account self.x: int(mouse.x/gridwidth)*gridwidth
I have a grid that I want an sprite to move to the cursors position but snap to the grid correctly.
Develop games in your browser. Powerful, performant & highly capable.
Offset the origin point for your cursor sprite. Have a look at the example I posted in this topic yesterday.