diff options
Diffstat (limited to 'tilemap.lua')
| -rw-r--r-- | tilemap.lua | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tilemap.lua b/tilemap.lua index ab2a52c..8ad1c9c 100644 --- a/tilemap.lua +++ b/tilemap.lua @@ -1,4 +1,6 @@ local Entity = require("entity") +local Liquid = require("liquid") +local LiquidSurface = require("liquidSurface") local Tilemap = {} Tilemap.__index = Tilemap @@ -34,8 +36,11 @@ local function objectToEntity(obj) type = obj.type, id = obj.id, rotation = obj.rotation, - visible = obj.visible + visible = obj.visible, + shape = obj.shape }) + entity.polygon = obj.polygon + entity.polyline = obj.polyline return entity end @@ -45,6 +50,8 @@ function Tilemap:new(mapPath, tilesets) self.entitiesTiles = {} self.entitiesSpawns = {} self.entitiesCameraBorders = {} + self.entitiesLiquidPolygons = {} + self.entitiesLiquidSurfaces = {} self.layerBackground = nil self.layerGround = nil self.layerForeground = nil @@ -117,6 +124,10 @@ function Tilemap:new(mapPath, tilesets) table.insert(self.entitiesSpawns, entity) elseif name == "camera_border" then table.insert(self.entitiesCameraBorders, entity) + elseif name == "liquid" then + table.insert(self.entitiesLiquidPolygons, Liquid:new(entity)) + elseif name == "liquid_surface" then + table.insert(self.entitiesLiquidSurfaces, LiquidSurface:new(entity)) end end end @@ -126,6 +137,14 @@ function Tilemap:new(mapPath, tilesets) return self end +function Tilemap:getEntitiesLiquidPolygons() + return self.entitiesLiquidPolygons +end + +function Tilemap:getEntitiesLiquidSurfaces() + return self.entitiesLiquidSurfaces +end + function Tilemap:getEntitiesTiles() return self.entitiesTiles end |
