remove noble
This commit is contained in:
@@ -53,8 +53,12 @@ function Player:init(x, y)
|
||||
Player.bat = Player.fullBat
|
||||
Player.dischargeRate = 1
|
||||
Player.moveRight = false
|
||||
Player.moveLeft = false -- TODO: refactor to use a single variable
|
||||
self.lastDirection = nil
|
||||
self.targetDone = false
|
||||
|
||||
|
||||
self.debug = Noble.Settings.get("debug")
|
||||
end
|
||||
|
||||
function Player:handleInput()
|
||||
@@ -68,6 +72,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
|
||||
Player.moveLeft = false
|
||||
self.animation:setState("down")
|
||||
end
|
||||
|
||||
@@ -78,6 +83,8 @@ function Player:handleInput()
|
||||
end
|
||||
self:changeToRunState("left")
|
||||
self.lastDirection = "left"
|
||||
Player.moveLeft = true
|
||||
Player.moveRight = false
|
||||
self.xVelocity = self.xVelocity - self.acceleration
|
||||
elseif playdate.buttonIsPressed(playdate.kButtonRight) then
|
||||
if self.lastDirection == "left" then
|
||||
@@ -85,6 +92,7 @@ function Player:handleInput()
|
||||
end
|
||||
self:changeToRunState("right")
|
||||
Player.moveRight = true
|
||||
Player.moveLeft = false
|
||||
self.lastDirection = "right"
|
||||
self.xVelocity = self.xVelocity + self.acceleration
|
||||
end
|
||||
@@ -95,10 +103,12 @@ function Player:handleInput()
|
||||
|
||||
-- Y velocity
|
||||
if crankChange ~= 0 then
|
||||
if crankChange > 0 then
|
||||
self.animation:setState("up")
|
||||
else
|
||||
self.animation:setState("down")
|
||||
if Player.moveRight == false and Player.moveLeft == false then
|
||||
if crankChange > 0 then
|
||||
self.animation:setState("up")
|
||||
else
|
||||
self.animation:setState("down")
|
||||
end
|
||||
end
|
||||
self.yInertia = self.yInertia - (acceleratedChange * 0.007)
|
||||
else
|
||||
@@ -173,6 +183,9 @@ function Player:handleMovementAndCollisions()
|
||||
self:boom()
|
||||
return
|
||||
elseif collisionTag == 154 then -- Baleba
|
||||
if self.debug then
|
||||
return
|
||||
end
|
||||
self:boom(collisionObject)
|
||||
return
|
||||
elseif collisionTag == 2 then -- Tank
|
||||
|
Reference in New Issue
Block a user