game.gravity = function(character, dt) if character.jump.velocity ~= 0 then character.jump.isJumping = true character.position.y = character.position.y + (character.jump.velocity * dt) character.jump.velocity = character.jump.velocity - (character.gravity * dt) end if character.position.y > character.jump.ground then character.jump.velocity = 0 character.position.y = character.jump.ground character.jump.higher = character.jump.higherMax character.jump.limitButtonJump = false character.jump.isJumping = false character.actionA = false if love.keyboard.isScancodeDown(button.up) then character.actionUp = true elseif love.keyboard.isScancodeDown(button.down) then character.actionDown = true end end end