Grid-based Movement
-
AStarGrid2D: Coordinate transformation equation depending on chosen projection .
-
Devlog about a turn-based grid combat game .
-
Quite interesting.
-
I found the OOP system well done.
-
-
Using a tilemap:
-
This creates coupling between the Tilemap and Entities, which I don't like.
-
It also makes things awkward if you want to use a background that is not tilemap-based.
-
Grid-based movement using tiles from a tilemap (1) .
-
The entity moves forward while the sprite teleports backward and is moved slowly forward.
-
This is useful to "reserve" a cell so there are no conflicts between entities trying to go to the same cell.
-
-
-
Grid-based movement using tiles in a tilemap (2) .
-
The entity moves forward while the sprite teleports backward and is moved slowly forward.
-
This is useful to "reserve" a cell so there are no conflicts between entities trying to go to the same cell.
-
-
The decoupling in this video is a bit better than the above video, by keeping tilemap-related code inside the Tilemap; the player only uses the Tilemap to get the new position information after movement.
-
At the same time, the scene structure is quite messy and requires all entities to be children of the Tilemap and creates a somewhat inflexible "actors" system.
-
-
-
Using snap on the grid: