I’m working on turn-based RPG without physics and faced the problem of collision check with walls.
How can I get the tile at exact position?
I mean not the tile coordinate in tilemap, but it’s real world coordinates.
In documentation mentioned only one example, where we can use real coordinates - changing specific tile with message:
local tile_num = 1 -- some tile
local pos = go.get_position()
msg.post("/level#tilemap", "set_tile", { layer_id = hash("floor"), position = vmath.vector3(pos.x, pos.y, 0), tile = tile_num})
What would be a right solution:
- manually transform world coordinates to tile coordinates and use
tilemap.get_tile()
- or create and check for collision? (but I’m not using physics )
?