Load background image and draw it
parent
9fc543a95a
commit
f8bff917f1
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
14
main.lua
14
main.lua
|
|
@ -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)
|
function love.keypressed(key, scan_code, is_repeat)
|
||||||
if key == 'escape' then
|
if key == 'escape' then
|
||||||
love.event.quit()
|
love.event.quit()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue