Original Post
Hello!
My question is simple:
Is there a mathematical way to redo a map-to-screen-calculation?
i mean screen-xy (235,34) back to map-coordinates(eg 3,3)
thx!!!
quote:
i didn''t really get what evillive ment with that:
map_x = obj_world_x/tile_width;
map_y = obj_world_y/tile_height;
quote:
Original post by evillive2
you probably have some kind of world coordinates for your object. Use that to get the map position:
map_x = obj_world_x/tile_width;
map_y = obj_world_y/tile_height;
BYTE gMask[TILE_Y][TILE_X] = {
{1, 1, 1, 0, 0, 4, 4, 4 },
{1, 1, 0, 0, 0, 0, 4, 4 },
{1, 0, 0, 0, 0, 0, 0, 4 },
{0, 0, 0, 0, 0, 0, 0, 0 },
{2, 0, 0, 0, 0, 0, 0, 3 },
{2, 2, 0, 0, 0, 0, 3, 3 },
{2, 2, 2, 0, 0, 0, 3, 3 },
{2, 2, 2, 2, 0, 3, 3, 3 },
};
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more