fix inertia
This commit is contained in:
parent
4f6d0a6c24
commit
9cd5c1bd81
@ -34,7 +34,7 @@ function Player:init(x, y)
|
||||
|
||||
-- Physics properties
|
||||
self.fallSpeed = 0.05
|
||||
self.xVelocity = 0
|
||||
self.xVelocity = -0.5
|
||||
self.yVelocity = self.fallSpeed
|
||||
self.maxXSpeed = 2
|
||||
self.maxYSpeed = 5
|
||||
@ -67,6 +67,7 @@ function Player:handleInput()
|
||||
if not playdate.buttonIsPressed(playdate.kButtonLeft) and not playdate.buttonIsPressed(playdate.kButtonRight) then
|
||||
self.xVelocity = self.xVelocity * self.friction
|
||||
Player.moveRight = false
|
||||
self.animation:setState("down")
|
||||
end
|
||||
|
||||
local isChangingDirection = false
|
||||
@ -101,7 +102,6 @@ function Player:handleInput()
|
||||
self.yInertia = self.yInertia - (acceleratedChange * 0.007)
|
||||
else
|
||||
self.yInertia = self.yInertia * self.friction
|
||||
self.animation:setState("down")
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user