Develop #4

Merged
wariosolis merged 35 commits from develop into master 2017-01-04 00:04:34 +01:00
16 changed files with 90 additions and 6 deletions
Showing only changes of commit c17ac46781 - Show all commits
+2 -2
View File
@@ -4,12 +4,12 @@ local gamera = require 'assets/scripts/vendor/gamera'
function game.load() function game.load()
-- Configuration -- Configuration
math.randomseed(os.time()) math.randomseed(os.time())
local width, height = 1280, 720 local width, height = 1279, 720
local canvas_width, canvas_height = 2280, 720 local canvas_width, canvas_height = 2280, 720
game.window = { width = width , height = height } game.window = { width = width , height = height }
game.canvas = { x = width / 2, y= 0, width = canvas_width, height = canvas_height } game.canvas = { x = width / 2, y= 0, width = canvas_width, height = canvas_height }
game.level = 1 game.level = 1
game.end_level = 2 game.end_level = 5
love.window.setMode(game.window.width, game.window.height) love.window.setMode(game.window.width, game.window.height)
+2 -2
View File
@@ -6,9 +6,9 @@ local stage1 = {}
local image local image
function stage1.load(game, camera) 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) game:setNewSizeWorld(stage1.world.w, stage1.world.h)
image = love.graphics.newImage('assets/sprites/background/bg.jpg')
arrows.load(game, stage1, camera) arrows.load(game, stage1, camera)
game.canvas.x = game.window.width game.canvas.x = game.window.width
end end
+1 -1
View File
@@ -6,7 +6,7 @@ local stage2 = {}
local image local image
function stage2.load(game, camera) 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} stage2.world = { w = image:getWidth(), h= 720}
game:setNewSizeWorld(stage2.world.w, stage2.world.h) game:setNewSizeWorld(stage2.world.w, stage2.world.h)
arrows.load(game, stage2, camera) arrows.load(game, stage2, camera)
+25
View File
@@ -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
+25
View File
@@ -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
+25
View File
@@ -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
+8 -1
View File
@@ -15,9 +15,16 @@ end
function stages.update(dt, game, camera) function stages.update(dt, game, camera)
if game.level ~= currentLevel then if game.level ~= currentLevel then
back_pressed = false
if game.level < currentLevel then
back_pressed = true
end
currentLevel = game.level currentLevel = game.level
dynamic_stage = require("assets/scripts/stage"..currentLevel) 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) dynamic_stage.update(dt, game)
else else
dynamic_stage.update(dt, game) dynamic_stage.update(dt, game)
+2
View File
@@ -7,6 +7,7 @@ local image
function stress.load(game, camera) function stress.load(game, camera)
image = love.graphics.newImage('assets/sprites/stress/stress.png') image = love.graphics.newImage('assets/sprites/stress/stress.png')
end end
function stress.update(dt, game) function stress.update(dt, game)
@@ -17,6 +18,7 @@ end
function stress.draw() function stress.draw()
if stress.stress == true then if stress.stress == true then
cam_x, cam_y = camera.gcam:getVisible() cam_x, cam_y = camera.gcam:getVisible()
love.graphics.setColor(255, 255, 255, 90)
love.graphics.draw(image, cam_x, cam_y) love.graphics.draw(image, cam_x, cam_y)
end end
end end
Binary file not shown.

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 85 KiB