2022-01-17 23:14:54 +00:00
|
|
|
Decoration = Entity:New(x,y)
|
|
|
|
|
|
|
|
function Decoration:New(x,y,animation,lightRange)
|
|
|
|
local o = Entity:New(x,y)
|
|
|
|
|
2022-02-10 17:18:37 +00:00
|
|
|
o.type = "decoration"
|
|
|
|
|
2022-01-17 23:14:54 +00:00
|
|
|
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
|
2022-02-05 11:32:47 +00:00
|
|
|
o.light = CreateLight(o.pos.x,o.pos.y,o.lightRange)
|
2022-01-17 23:14:54 +00:00
|
|
|
end
|
|
|
|
|
2022-02-10 17:18:37 +00:00
|
|
|
table.insert(LoadedObjects.Entities,o)
|
|
|
|
o.id = #LoadedObjects.Entities
|
2022-01-19 22:29:02 +00:00
|
|
|
|
2022-01-17 23:14:54 +00:00
|
|
|
setmetatable(o, self)
|
|
|
|
self.__index = self
|
|
|
|
return o
|
2022-01-19 22:29:02 +00:00
|
|
|
end
|
2022-01-17 23:14:54 +00:00
|
|
|
|
|
|
|
function Decoration:HandleAnimation()
|
|
|
|
self.body:Animate()
|
|
|
|
self:Draw(self.body)
|
|
|
|
end
|
|
|
|
|
|
|
|
function Decoration:DoPhysics()
|
|
|
|
end
|