Snapping a tile to a grid
Hi. I'm making a puzzle game and need the actor (tile) to snap to the grid after its been dragged by the player (like Tetris, Puzzle League Planet). The tile can only move in the X but will drop in the Y axis if nothing is underneath it.
Done the movement on the X axis but unsure how to 'snap' the tile to a set point once the player releases the tile.
At a guess once the tile is released I need the attribute to self lock and have a Real attribute offset x? Thanks
(very bad illustration of what I want to do)
http://i1114.photobucket.com/albums/k539/toecutter78/gridmovement.jpg
Done the movement on the X axis but unsure how to 'snap' the tile to a set point once the player releases the tile.
At a guess once the tile is released I need the attribute to self lock and have a Real attribute offset x? Thanks
(very bad illustration of what I want to do)
http://i1114.photobucket.com/albums/k539/toecutter78/gridmovement.jpg
Comments