2022-02-15 09:21:24 +00:00
|
|
|
HookAnchor = Entity:New(x,y)
|
|
|
|
|
|
|
|
function HookAnchor:New(x,y,hookDistance)
|
|
|
|
local o = Entity:New(x,y)
|
|
|
|
|
|
|
|
o.type = "hook_anchor"
|
|
|
|
|
|
|
|
o.pos = {x = x, y = y}
|
|
|
|
o.hookDistance = hookDistance or 100
|
|
|
|
-- animations
|
|
|
|
o.body = Animation:New(animation.fairy.flying)
|
|
|
|
o:centerOffset(o.body)
|
|
|
|
o:getBoundingBox(o.body)
|
|
|
|
|
|
|
|
|
|
|
|
table.insert(LoadedObjects.Entities,o)
|
|
|
|
o.id = #LoadedObjects.Entities
|
|
|
|
|
|
|
|
setmetatable(o, self)
|
|
|
|
self.__index = self
|
|
|
|
return o
|
|
|
|
end
|
|
|
|
|
|
|
|
function HookAnchor:HandleAnimation()
|
2022-02-15 09:44:02 +00:00
|
|
|
love.graphics.circle(
|
|
|
|
"line",
|
|
|
|
-Camera.pos.x + self.pos.x,
|
|
|
|
-Camera.pos.y + self.pos.y,
|
|
|
|
self.hookDistance
|
|
|
|
)
|
2022-02-15 09:21:24 +00:00
|
|
|
self.body:Animate()
|
|
|
|
self:Draw(self.body)
|
|
|
|
end
|
|
|
|
|
|
|
|
function HookAnchor:DoPhysics()
|
|
|
|
end
|
2022-02-15 09:44:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
function Fairy:Debug()
|
|
|
|
Entity.Debug(self)
|
|
|
|
end
|