-
-
Save ianfitzpatrick/cd5b5c98cb447558b43fe18569d6ce9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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