Load background image and draw it
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@@ -1,3 +1,17 @@
|
||||
local game = {}
|
||||
|
||||
function love.load(arg)
|
||||
game.images = {}
|
||||
|
||||
game.images.background = love.graphics.newImage('images/background.png')
|
||||
game.images.background_width = game.images.background:getWidth()
|
||||
end
|
||||
|
||||
function love.draw()
|
||||
love.graphics.draw(game.images.background, 0, 0)
|
||||
love.graphics.draw(game.images.background, game.images.background_width, 0)
|
||||
end
|
||||
|
||||
function love.keypressed(key, scan_code, is_repeat)
|
||||
if key == 'escape' then
|
||||
love.event.quit()
|
||||
|
||||
Reference in New Issue
Block a user