diff --git a/steps/1_hello/main.lua b/steps/1_hello/main.lua new file mode 100644 index 0000000..cdecc84 --- /dev/null +++ b/steps/1_hello/main.lua @@ -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 diff --git a/steps/2_layout/main.lua b/steps/2_layout/main.lua new file mode 100644 index 0000000..740a12b --- /dev/null +++ b/steps/2_layout/main.lua @@ -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 diff --git a/steps/3_background/assets/sprites/background.jpg b/steps/3_background/assets/sprites/background.jpg new file mode 100644 index 0000000..cebdb04 Binary files /dev/null and b/steps/3_background/assets/sprites/background.jpg differ diff --git a/steps/3_background/main.lua b/steps/3_background/main.lua new file mode 100644 index 0000000..9892176 --- /dev/null +++ b/steps/3_background/main.lua @@ -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