34 lines
591 B
Lua
34 lines
591 B
Lua
|
Decoration = Entity:New(x,y)
|
||
|
|
||
|
function Decoration:New(x,y,animation,lightRange)
|
||
|
local o = Entity:New(x,y)
|
||
|
|
||
|
o.pos = {x = x, y = y}
|
||
|
|
||
|
-- animations
|
||
|
o.body = Animation:New(animation)
|
||
|
o:centerOffset(o.body)
|
||
|
o:getBoundingBox(o.body)
|
||
|
|
||
|
if lightRange ~= nil then
|
||
|
o.lightRange = lightRange
|
||
|
o.light = CreateLight(o.pos.x,o.pos.y,o.lightRange,nil,60/6)
|
||
|
end
|
||
|
|
||
|
setmetatable(o, self)
|
||
|
self.__index = self
|
||
|
|
||
|
return o
|
||
|
end
|
||
|
|
||
|
function Decoration:Smart()
|
||
|
end
|
||
|
|
||
|
function Decoration:HandleAnimation()
|
||
|
self.body:Animate()
|
||
|
self:Draw(self.body)
|
||
|
end
|
||
|
|
||
|
function Decoration:DoPhysics()
|
||
|
end
|