I'm making a game that involves "falling block" gameplay elements. The problem is, I'm not quite sure how to make it so that the blocks will snap to some kind of grid, in other words, I'm not sure how it will pick the closest cell to its position.
The blocks are not continuously snapping to a grid (i.e. they are subject to gravity). Any tips?