swing adjustment. :)
This commit is contained in:
@@ -113,10 +113,11 @@ function Player:Smart()
|
||||
if self.dashCooldownTimer == 0
|
||||
and not self.isDashing
|
||||
and self.dashCount > 0 then
|
||||
self:Unhook()
|
||||
|
||||
-- state player
|
||||
self.dashCount = self.dashCount - 1
|
||||
self.isDashing = true
|
||||
self.dashCount = self.dashCount - 1
|
||||
|
||||
-- get dash direction
|
||||
local vertical = 0
|
||||
@@ -142,7 +143,7 @@ function Player:Smart()
|
||||
|
||||
if Keybind:CheckPressed(Keybind.move.hook) then
|
||||
if self.isHooked then
|
||||
self.isHooked = false
|
||||
self:Unhook()
|
||||
else
|
||||
local anchor = self:CheckNearest("decoration",self.hookDistance)
|
||||
if anchor then
|
||||
@@ -207,6 +208,8 @@ function Player:DoPhysics()
|
||||
}
|
||||
Particle:New(self.pos.x,self.pos.y,particle_data)
|
||||
local hook_angle = GetAngleFromVector(hook[1],hook[2])-math.rad(180)
|
||||
if Keybind:CheckDown(Keybind.move.right) then hook_angle = hook_angle - math.rad(0.05) end
|
||||
if Keybind:CheckDown(Keybind.move.left) then hook_angle = hook_angle + math.rad(0.05) end
|
||||
local pos_x = self.hookAnchor.x + self.hookedDistance * math.cos(hook_angle)
|
||||
local pos_y = self.hookAnchor.y + self.hookedDistance * math.sin(hook_angle)
|
||||
self.vel.x = self.vel.x + pos_x - self.pos.x
|
||||
@@ -292,3 +295,8 @@ function Player:HandleAnimation()
|
||||
end
|
||||
self.move_x = 0
|
||||
end
|
||||
|
||||
function Player:Unhook()
|
||||
self.isHooked = false
|
||||
self.hookAnchor = nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user