Skip to content

Instantly share code, notes, and snippets.

@videlais

videlais/update.lua Secret

Created Apr 10, 2018
Embed
What would you like to do?
Updated update.lua function
function love.update(dt)
-- Feed the world the current delta time (dt)
world:update(dt)
if love.keyboard.isDown("up") then
player.body:applyForce(0, -40)
end
if love.keyboard.isDown("down") then
player.body:applyForce(0, 40)
end
if love.keyboard.isDown("left") then
player.body:applyForce(-40, 0)
end
if love.keyboard.isDown("right") then
player.body:applyForce(40, 0)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.