Skip to content

Instantly share code, notes, and snippets.

@videlais
Created April 12, 2018 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save videlais/fb71814d8cbb46ab2b7604c40d3efd04 to your computer and use it in GitHub Desktop.
Save videlais/fb71814d8cbb46ab2b7604c40d3efd04 to your computer and use it in GitHub Desktop.
Updated main.lua
require("player")
function love.load()
-- A meter will be 64px
love.physics.setMeter(64)
-- Set the X gravity, Y gravity, and if objects can sleep
world = love.physics.newWorld( 0, 0, true )
-- Send the world to the player so that it will be also be in the "world"
player = Player(world)
end
function love.update(dt)
-- Feed the world the current delta time (dt)
world:update(dt)
-- Update the player object
player:update()
end
function love.draw()
-- Draw the player object
player:draw()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment