New steps

This commit is contained in:
Andros 2018-05-13 22:05:48 +02:00
parent 105c95fc9d
commit 3c0dd6f667
4 changed files with 58 additions and 0 deletions

13
steps/1_hello/main.lua Normal file
View File

@ -0,0 +1,13 @@
function love.load()
love.window.setMode(800, 480)
end
function love.draw()
love.graphics.print('Hola a todos!!', 400 , 200)
end
function love.keypressed(key, scancode, isrepeat)
if key == 'escape' then
love.event.push('quit')
end
end

19
steps/2_layout/main.lua Normal file
View File

@ -0,0 +1,19 @@
function love.load()
game = {}
game.width = 800
game.height = 480
love.window.setMode(game.width, game.height)
end
function love.update(dt)
end
function love.draw()
end
-- Controls
function love.keypressed(key, scancode, isrepeat)
if key == 'escape' then
love.event.push('quit')
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -0,0 +1,26 @@
function love.load()
game = {}
game.width = 800
game.height = 480
love.window.setMode(game.width, game.height)
-- Background
background = {}
background.img = love.graphics.newImage('assets/sprites/background.jpg')
background.x = 0
background.y = 0
end
function love.update(dt)
end
function love.draw()
-- Background
love.graphics.draw(background.img, background.x, background.y)
end
-- Controls
function love.keypressed(key, scancode, isrepeat)
if key == 'escape' then
love.event.push('quit')
end
end