Coordinates on the top left corner or center of the tile
Posted
by
soimon
on Game Development
See other posts from Game Development
or by soimon
Published on 2012-12-13T15:01:02Z
Indexed on
2012/12/13
17:17 UTC
Read the original article
Hit count: 603
tiles
|coordinates
I'm setting up a tile system where every tile has x
and y
coordinates. Right now I assume that the top left corner of the tile is positioned on it's coordinate on the screen, x = tileX * tileWidth
and y = tileY x tileWidth
.
However, it seems strange that the tile with coordinate (0, 0)
is completely drawn in the 'positive' side of the coordinate system as opposed to in the center of the origin.
Is it common practice to assume that a coordinate lays in the center of a tile or at the top left corner of a tile? So basically x = tileX x tileWidth
or x = tileX x tilewidth - ( tileWidth / 2 )
?
© Game Development or respective owner