Develop #4
@@ -4,12 +4,12 @@ local gamera = require 'assets/scripts/vendor/gamera'
|
||||
function game.load()
|
||||
-- Configuration
|
||||
math.randomseed(os.time())
|
||||
local width, height = 1280, 720
|
||||
local width, height = 1279, 720
|
||||
local canvas_width, canvas_height = 2280, 720
|
||||
game.window = { width = width , height = height }
|
||||
game.canvas = { x = width / 2, y= 0, width = canvas_width, height = canvas_height }
|
||||
game.level = 1
|
||||
game.end_level = 2
|
||||
game.end_level = 5
|
||||
|
||||
love.window.setMode(game.window.width, game.window.height)
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ local stage1 = {}
|
||||
local image
|
||||
|
||||
function stage1.load(game, camera)
|
||||
stage1.world = { w = 2560, h= 720}
|
||||
image = love.graphics.newImage('assets/sprites/background/fondo_mesilla.jpg')
|
||||
stage1.world = { w = image:getWidth(), h= 720}
|
||||
game:setNewSizeWorld(stage1.world.w, stage1.world.h)
|
||||
image = love.graphics.newImage('assets/sprites/background/bg.jpg')
|
||||
arrows.load(game, stage1, camera)
|
||||
game.canvas.x = game.window.width
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ local stage2 = {}
|
||||
local image
|
||||
|
||||
function stage2.load(game, camera)
|
||||
image = love.graphics.newImage('assets/sprites/background/santabiblia.jpg')
|
||||
image = love.graphics.newImage('assets/sprites/background/fondo_chimenea.jpg')
|
||||
stage2.world = { w = image:getWidth(), h= 720}
|
||||
game:setNewSizeWorld(stage2.world.w, stage2.world.h)
|
||||
arrows.load(game, stage2, camera)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
local anim8 = require 'assets/scripts/vendor/anim8'
|
||||
local tools = require 'assets/scripts/tools'
|
||||
local arrows = require 'assets/scripts/arrows'
|
||||
|
||||
local stage2 = {}
|
||||
local image
|
||||
|
||||
function stage2.load(game, camera)
|
||||
image = love.graphics.newImage('assets/sprites/background/fondo_tocadiscos.jpg')
|
||||
stage2.world = { w = image:getWidth(), h= 720}
|
||||
game:setNewSizeWorld(stage2.world.w, stage2.world.h)
|
||||
arrows.load(game, stage2, camera)
|
||||
game.canvas.x = game.window.width / 2
|
||||
end
|
||||
|
||||
function stage2.update(dt, game)
|
||||
arrows.update(dt)
|
||||
end
|
||||
|
||||
function stage2.draw()
|
||||
love.graphics.draw(image)
|
||||
arrows.draw()
|
||||
end
|
||||
|
||||
return stage2
|
||||
@@ -0,0 +1,25 @@
|
||||
local anim8 = require 'assets/scripts/vendor/anim8'
|
||||
local tools = require 'assets/scripts/tools'
|
||||
local arrows = require 'assets/scripts/arrows'
|
||||
|
||||
local stage4 = {}
|
||||
local image
|
||||
|
||||
function stage4.load(game, camera)
|
||||
image = love.graphics.newImage('assets/sprites/background/fondo_libros.jpg')
|
||||
stage4.world = { w = image:getWidth(), h= 720}
|
||||
game:setNewSizeWorld(stage4.world.w, stage4.world.h)
|
||||
arrows.load(game, stage4, camera)
|
||||
game.canvas.x = game.window.width / 2
|
||||
end
|
||||
|
||||
function stage4.update(dt, game)
|
||||
arrows.update(dt)
|
||||
end
|
||||
|
||||
function stage4.draw()
|
||||
love.graphics.draw(image)
|
||||
arrows.draw()
|
||||
end
|
||||
|
||||
return stage4
|
||||
@@ -0,0 +1,25 @@
|
||||
local anim8 = require 'assets/scripts/vendor/anim8'
|
||||
local tools = require 'assets/scripts/tools'
|
||||
local arrows = require 'assets/scripts/arrows'
|
||||
|
||||
local stage5 = {}
|
||||
local image
|
||||
|
||||
function stage5.load(game, camera)
|
||||
image = love.graphics.newImage('assets/sprites/background/fondo_fotomadre.jpg')
|
||||
stage5.world = { w = image:getWidth(), h= 720}
|
||||
game:setNewSizeWorld(stage5.world.w, stage5.world.h)
|
||||
arrows.load(game, stage5, camera)
|
||||
game.canvas.x = game.window.width / 2
|
||||
end
|
||||
|
||||
function stage5.update(dt, game)
|
||||
arrows.update(dt)
|
||||
end
|
||||
|
||||
function stage5.draw()
|
||||
love.graphics.draw(image)
|
||||
arrows.draw()
|
||||
end
|
||||
|
||||
return stage5
|
||||
@@ -15,9 +15,16 @@ end
|
||||
|
||||
function stages.update(dt, game, camera)
|
||||
if game.level ~= currentLevel then
|
||||
back_pressed = false
|
||||
if game.level < currentLevel then
|
||||
back_pressed = true
|
||||
end
|
||||
currentLevel = game.level
|
||||
dynamic_stage = require("assets/scripts/stage"..currentLevel)
|
||||
dynamic_stage.load(game, camera)
|
||||
dynamic_stage.load(game, camera, back_pressed)
|
||||
if back_pressed then
|
||||
game.canvas.x = dynamic_stage.world.w - (game.window.width / 2)
|
||||
end
|
||||
dynamic_stage.update(dt, game)
|
||||
else
|
||||
dynamic_stage.update(dt, game)
|
||||
|
||||
@@ -7,6 +7,7 @@ local image
|
||||
|
||||
function stress.load(game, camera)
|
||||
image = love.graphics.newImage('assets/sprites/stress/stress.png')
|
||||
|
||||
end
|
||||
|
||||
function stress.update(dt, game)
|
||||
@@ -17,6 +18,7 @@ end
|
||||
function stress.draw()
|
||||
if stress.stress == true then
|
||||
cam_x, cam_y = camera.gcam:getVisible()
|
||||
love.graphics.setColor(255, 255, 255, 90)
|
||||
love.graphics.draw(image, cam_x, cam_y)
|
||||
end
|
||||
end
|
||||
|
||||
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 200 KiB |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 85 KiB |