Register
Handmade Hero»Forums»Game»Day 30 TileRelX and TileRelY What means?
Dave Wang
2 posts
Day 30 TileRelX and TileRelY What means?
2 years, 8 months ago Edited by Dave Wang on Feb. 16, 2017, 6:55 a.m.
Is player in tile pos?

Every day up!
26 posts
Day 30 TileRelX and TileRelY What means?
2 years, 8 months ago
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?
2 years, 8 months ago
Thinks! Brian.

Every day up!