diff --git a/code/entities/player.lua b/code/entities/player.lua index 110de58..2edbfcd 100644 --- a/code/entities/player.lua +++ b/code/entities/player.lua @@ -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 diff --git a/main.lua b/main.lua index 3234529..c1846c1 100644 --- a/main.lua +++ b/main.lua @@ -22,7 +22,8 @@ function love.load() game = { scale = 2, width = love.graphics.getWidth(), - height = love.graphics.getHeight() + height = love.graphics.getHeight(), + framerate = 60 } require "code/require"