hook anchors. player animation fixed.
This commit is contained in:
35
code/entities/hook_anchor.lua
Normal file
35
code/entities/hook_anchor.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
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()
|
||||
self.body:Animate()
|
||||
self:Draw(self.body)
|
||||
|
||||
local particle_data = {
|
||||
animation = animation.particle.simple,
|
||||
sprite_tint = HEX2RGB("#fed100")
|
||||
}
|
||||
end
|
||||
|
||||
function HookAnchor:DoPhysics()
|
||||
end
|
||||
Reference in New Issue
Block a user