fix platformer example w/ dt

This commit is contained in:
Jill 2022-09-25 15:08:20 +03:00
parent 12700cb4e8
commit 88a4ebe180
1 changed files with 2 additions and 2 deletions

View File

@ -1091,7 +1091,7 @@ local input = require('stdlib.input')
local DAMPING = 1/9500
local SPEED = 2
local JUMP_FORCE = 32
local GRAVITY = 2.3
local GRAVITY = 123
local PLAYER_SIZE = 50
local groundY = sh * 0.8
@ -1129,7 +1129,7 @@ function uranium.update(dt)
end
-- apply gravity
vel.y = vel.y + GRAVITY
vel.y = vel.y + GRAVITY * dt
-- update position, apply damping to velocity
pos = pos + vel