scenes/levels: add new map handling function and wrapper

This commit is contained in:
Kazhnuz 2019-03-03 13:53:35 +01:00
parent 26e9d7c4d5
commit 581fd9952e
1 changed files with 16 additions and 0 deletions

View File

@ -110,6 +110,22 @@ function Level:getEntities()
return self.entities:getItems()
end
-- MAP FUNCTIONS
-- All map wrappers
function Level:getDimensions()
return self.map.width * self.map.tilewidth,
self.map.height * self.map.tileheight
end
function Level:setBackgroundColor(r, g, b)
self.backcolor = {r, g, b}
end
function Level:getBackgroundColor()
return self.backcolor[1]/256, self.backcolor[2]/256, self.backcolor[3]/256
end
-- UPDATE FUNCTIONS
-- All update functions