blob: af8388a9d03a835592473ec91820576684f9e50d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
local gravityModule = {}
function gravityModule.motion(dt)
gravity(dt)
end
function gravity(dt)
if character.bola.jump.velocity ~= 0 then
character.bola.position.y = character.bola.position.y + (character.bola.jump.velocity * dt)
character.bola.jump.velocity = character.bola.jump.velocity - (character.bola.gravity * dt)
end
if character.bola.position.y > character.bola.jump.ground then
character.bola.jump.velocity = 0
character.bola.position.y = character.bola.jump.ground
character.bola.jump.higher = character.bola.jump.higherMax
character.bola.jump.limitButtonJump = false
character.bola.actionA = false
end
end
return gravityModule
|