Skip to content

Instantly share code, notes, and snippets.

@ianfitzpatrick
Last active August 19, 2016 03:17
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 ianfitzpatrick/cd5b5c98cb447558b43fe18569d6ce9b to your computer and use it in GitHub Desktop.
Save ianfitzpatrick/cd5b5c98cb447558b43fe18569d6ce9b to your computer and use it in GitHub Desktop.
io.stdout:setvbuf('no')
debug = true
function love.load(arg)
love.window.setMode( 1280, 720)
bg = { x = 0, y = 0 }
bg.img = love.graphics.newImage('assets/graphics/backgrounds/football_field_bg.png')
t = 0
end
function love.update(dt)
if love.keyboard.isDown("right", "d") then
t = (t or 0) + dt
end
while t > 0.1 do
bg.x = bg.x - 64
t = t - 0.1
end
end
function love.draw()
love.graphics.draw(bg.img, bg.x, bg.y)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment