Some games, I’m thinking tower defense, need to give the player the ability to drag symbols around. But you don’t always want to give the player free reign to drag it anywhere. Maybe you want them to only be able to position symbols in a grid. That’s what we’ll create here using ActionScript 3.
This is what we’re going to be creating. Try dragging the green square. It will snap so that it’s always in one of the grid squares.