fixed dash timer bad when lag
This commit is contained in:
parent
ce43e48723
commit
e62eae1564
|
@ -16,10 +16,10 @@ function Player:New(x,y)
|
|||
|
||||
o.jumpImpulse = 3.5 -- gameworld pixels
|
||||
|
||||
self.wallJumpImpulse = { x = 2.5, y = 3.5 }
|
||||
o.wallJumpImpulse = { x = 2.5, y = 3.5 }
|
||||
|
||||
o.coyoteAmount = 5 -- int
|
||||
o.coyoteValue = 5 -- frames
|
||||
o.coyoteAmount = 5 -- int
|
||||
|
||||
o.dashCooldownTime = 0.1 -- seconds
|
||||
o.dashCooldownTimer = 0 -- seconds
|
||||
|
@ -151,7 +151,7 @@ function Player:Smart()
|
|||
|
||||
-- set dash values
|
||||
self.dashDirection = GetAngleFromVector(horizontal, vertical)
|
||||
self.dashTimer = self.dashTime
|
||||
self.dashTimer = math.floor(self.dashTime * game.framerate)
|
||||
end
|
||||
else
|
||||
-- not dashing!
|
||||
|
@ -193,7 +193,7 @@ function Player:DoPhysics()
|
|||
self.isOnGround = false
|
||||
|
||||
-- adjust timers
|
||||
self.dashTimer = self.dashTimer - current_dt
|
||||
self.dashTimer = self.dashTimer - 1
|
||||
self.noDriftFrames = self.noDriftFrames - 1
|
||||
|
||||
-- DASH STATE
|
||||
|
|
Loading…
Reference in New Issue