7
votes
1answer
227 views

Square Grid Polygonal Terrain Query algorithm?

I have a square, fixed-grid terrain with one terrain type per grid unit in my game, and I want to do an arbitrary polygonal terrain query which returns all of the grid units enclosed/intersected by ...
-2
votes
1answer
170 views

In a regular grid, how can I tell which tile a position is in?

I have a position on the screen, how do I calculate which grid tile that position is inside? I know the number of tiles in the grid, and the size of the screen (including how many tiles fit on it ...
1
vote
2answers
2k views

How can I snap a game object's position to a grid?

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 ...