The X tiles are just guides left over from when I designed the levels. They denote the corners of the “rooms”.
Each level is stored in a tilemap - level1.tilemap
, level2.tilemap
… etc. but these are not directly displayed on the screen.
In common.collection/view
there is screen.tilemap
which room data is copied to for each room in turn when the player enters.
Check level.script
for the functions that deal with that.
local function initscreen(self)
for y = 2, 12 do
for x = 1, 16 do
local t = tilemap.get_tile("#tilemap", "world", x + (data.screen * 16), y)
tilemap.set_tile("/common/view#screen", "world", x, y, t)
end
end
end
This function copies the room data from the level tilemap to the display (screen) tilemap. Not the simplest way to display a tilemap but I wanted the make the game as optimal as possible, so it only updates and displays what is on the screen.