mike: Now resepcts delta time (dt)

This commit is contained in:
2017-07-25 18:41:25 -07:00
parent beb04e1451
commit 091e055841
3 changed files with 10 additions and 10 deletions

View File

@@ -33,7 +33,7 @@ function half_speed(object_speed)
end
end
function check_keys(object, screen)
function check_keys(object, screen, dt)
local newObject = {}
newObject.x = object.x
newObject.y = object.y
@@ -42,11 +42,11 @@ function check_keys(object, screen)
newObject.speed = object.speed
if love.keyboard.isDown(MOVE_RIGHT) then
newObject.x = newObject.x + half_speed(newObject.speed)
newObject.x = newObject.x + half_speed(newObject.speed * dt)
end
if love.keyboard.isDown(MOVE_LEFT) then
newObject.x = newObject.x - half_speed(newObject.speed)
newObject.x = newObject.x - half_speed(newObject.speed * dt)
end
if screen_col_detect(newObject, screen) then