feat: add dialogue

This commit is contained in:
2024-06-14 20:33:09 +03:00
parent 60002df6e1
commit 1349e92491
21 changed files with 839 additions and 42 deletions

View File

@@ -63,6 +63,7 @@ end
function Player:handleInput()
if Player.bat <= 0 or Player.dead then
self.yInertia = self.yInertia * self.friction
return
end
@@ -104,13 +105,17 @@ function Player:handleInput()
-- Y velocity
if crankChange ~= 0 then
if Player.moveRight == false and Player.moveLeft == false then
if crankChange > 0 then
self.animation:setState("up")
if crankChange < 0 then -- TODO: animation depending on inertia
if self.animation.current == "down" then -- TODO: ABSOLUTE BULLSHIT
self.animation:setState("up")
end
else
self.animation:setState("down")
if self.animation.current == "up" then
self.animation:setState("down")
end
end
end
self.yInertia = self.yInertia - (acceleratedChange * 0.007)
self.yInertia = self.yInertia - (acceleratedChange * 0.02)
else
self.yInertia = self.yInertia * self.friction
end
@@ -156,6 +161,10 @@ function Player:handleMovementAndCollisions()
xVel = 0
end
if self.y < -20 and yVel < 0 and Player.bat > 0 then
yVel = 0
end
local _, _, collisions, length = self:checkCollisions(self.x + xVel, self.y + yVel)
self.touchingGround = false