Mothback/code/entities/decoration.lua
lustlion 0acbfd5e9d more naming convention
now there are spawn objects!
now entity spawns are loaded from level!
now entity spawns are saved to level!
2022-03-08 09:34:51 +01:00

33 lines
570 B
Lua

Decoration = Entity:new()
Decoration.type = "Decoration"
function Decoration:new(x,y,animation,light_radius)
local o = Entity:new(x,y)
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