Handmade Hero»Forums»Game
Dave Wang
2 posts
Day 30 TileRelX and TileRelY What means?
Edited by Dave Wang on
Is player in tile pos?
23 posts
Day 30 TileRelX and TileRelY What means?
You are correct.

Casey explains it further in the Q & A @ 1:30:17 Question: Can you explain the raw_position and canonical_position again?

Casey
What I found writing the code, was in order to do a bunch of the computations that we wanted to do, we had to have a three-tiered structure. We wanted to know what tile map we were on, we needed to know which tile we were on the tile map, and then inside that tile we needed to know the X (TileRelX) and Y (TileRelY) offset in pixels. This is because our character moves continuously. That’s what the canonical_position is.


So in other words, it is the player's position, relative to the upper left of the tile.
Dave Wang
2 posts
Day 30 TileRelX and TileRelY What means?
Thinks! Brian.