Compare commits

..

No commits in common. "9ada88f4f5ab3671d4030e2937f0e4006ab27a6e" and "d3796a0204e991604d06c776b3255e4f5fdfd987" have entirely different histories.

3 changed files with 7 additions and 7 deletions

View File

@ -47,11 +47,11 @@ end
function Animation:animate() function Animation:animate()
if self.frames[self.frame] ~= 0 then if self.frames[self.frame] ~= 0 then
-- try to animate -- try to animate
self.subframe = self.subframe + self.speed self.subframe = self.subframe + 1
if self.subframe > self.frames[self.frame]*game.framerate then if self.subframe > self.frames[self.frame]*game.framerate then
self.subframe = self.subframe - self.frames[self.frame]*game.framerate self.subframe = self.subframe - self.frames[self.frame]*game.framerate
self.frame = self.frame + 1 self.frame = self.frame + self.speed
end end
-- cycle -- cycle

View File

@ -34,7 +34,10 @@ function Player:new(x,y)
-- hook values -- hook values
o.hook_swing_speed = math.rad(0.05) o.hook_swing_speed = math.rad(0.05)
o.hook_anchor = nil o.hook_anchor = {
x = nil,
y = nil
}
-- walljump values -- walljump values
o.walljump_nodrift_amount = 12 o.walljump_nodrift_amount = 12
@ -163,7 +166,7 @@ function Player:doLogic()
if self.is_hooked then if self.is_hooked then
self:unhook() self:unhook()
else else
local anchor = self:checkNearest("HookAnchor","hook_specific") local anchor = self:checkNearest("HookAnchor",self.hook_distance)
if anchor then if anchor then
self.is_hooked = true self.is_hooked = true
self.hook_distance = anchor.hook_distance self.hook_distance = anchor.hook_distance
@ -356,7 +359,6 @@ end
function Player:unhook() function Player:unhook()
self.is_hooked = false self.is_hooked = false
self.hook_anchor = nil self.hook_anchor = nil
self.hook_distance = nil
end end
function Player:debug() function Player:debug()

View File

@ -44,8 +44,6 @@ function Entity:checkNearest(type,maxdistance)
local distance_y = entity.pos.y - self.pos.y local distance_y = entity.pos.y - self.pos.y
local distance = math.sqrt(distance_x ^ 2 + distance_y ^ 2) local distance = math.sqrt(distance_x ^ 2 + distance_y ^ 2)
if maxdistance == "hook_specific" then maxdistance = entity.hook_distance end
if not maxdistance or distance < maxdistance then if not maxdistance or distance < maxdistance then
if shortest == -1 or distance < shortest then if shortest == -1 or distance < shortest then
shortest = distance shortest = distance