Mothback/code/entities/decoration.lua
2022-03-06 09:35:45 +01:00

34 lines
563 B
Lua

Decoration = Entity:new()
function Decoration:new(x,y,animation,light_radius)
local o = Entity:new(x,y)
o.type = "decoration"
o.pos = {x = x, y = y}
-- animations
o.body = Animation:new(animation)
o:centerOffset(o.body)
o:createBox(o.body)
if light_radius ~= nil then
o.light_radius = light_radius
o.light = Light:new(o.pos.x,o.pos.y,o.light_radius)
end
o:id()
setmetatable(o, self)
self.__index = self
return o
end
function Decoration:handleAnimation()
self.body:animate()
self:draw(self.body)
end
function Decoration:doPhysics()
end