fix platformer example w/ dt
This commit is contained in:
parent
12700cb4e8
commit
88a4ebe180
|
@ -1091,7 +1091,7 @@ local input = require('stdlib.input')
|
||||||
local DAMPING = 1/9500
|
local DAMPING = 1/9500
|
||||||
local SPEED = 2
|
local SPEED = 2
|
||||||
local JUMP_FORCE = 32
|
local JUMP_FORCE = 32
|
||||||
local GRAVITY = 2.3
|
local GRAVITY = 123
|
||||||
local PLAYER_SIZE = 50
|
local PLAYER_SIZE = 50
|
||||||
|
|
||||||
local groundY = sh * 0.8
|
local groundY = sh * 0.8
|
||||||
|
@ -1129,7 +1129,7 @@ function uranium.update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- apply gravity
|
-- apply gravity
|
||||||
vel.y = vel.y + GRAVITY
|
vel.y = vel.y + GRAVITY * dt
|
||||||
|
|
||||||
-- update position, apply damping to velocity
|
-- update position, apply damping to velocity
|
||||||
pos = pos + vel
|
pos = pos + vel
|
||||||
|
|
Loading…
Reference in New Issue