Develop #4

Merged
wariosolis merged 35 commits from develop into master 2017-01-04 00:04:34 +01:00
23 changed files with 166 additions and 21 deletions
Showing only changes of commit 4fc2dc4ce7 - Show all commits
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10 -2
View File
@@ -19,8 +19,16 @@ function arrows.update(dt, game)
end end
function arrows.draw() function arrows.draw()
love.graphics.draw(arrows.img_left, arrows.left_x, arrows.left_y) if arrows.game.level > 1 then
love.graphics.draw(arrows.img_right, arrows.right_x, arrows.right_y) love.graphics.draw(arrows.img_left, arrows.left_x, arrows.left_y)
end
if arrows.game.level < arrows.game.end_level then
love.graphics.draw(arrows.img_right, arrows.right_x, arrows.right_y)
end
if arrows.game.level == arrows.game.end_level then
arrows.game.var_end = true
end
end end
+7 -2
View File
@@ -9,7 +9,7 @@ function game.load()
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 = 6 game.end_level = 7
game.start_screen = true game.start_screen = true
love.window.setMode(game.window.width, game.window.height) love.window.setMode(game.window.width, game.window.height)
@@ -27,6 +27,7 @@ function game.load()
game.music = love.audio.newSource("assets/audio/music/theme_biblia.wav") game.music = love.audio.newSource("assets/audio/music/theme_biblia.wav")
game.stress = false game.stress = false
game.var_end = false
end end
@@ -34,7 +35,11 @@ function game.update(dt)
if game.bells_enable then if game.bells_enable then
game:stopMusic() game:stopMusic()
else else
game:playMusic() if game.var_end == false then
game:playMusic()
else
game:stopMusic()
end
end end
end end
+2 -2
View File
@@ -50,8 +50,8 @@ function stage2.mousepressed(game, messages, camera)
if game.status == 2 then if game.status == 2 then
cam_x, cam_y = camera.gcam:getVisible() cam_x, cam_y = camera.gcam:getVisible()
if mos_x + cam_x > 527 and mos_x + cam_x < 653 and mos_y - cam_y > 335 and mos_y - cam_y < 423 then if mos_x + cam_x > 527 and mos_x + cam_x < 653 and mos_y - cam_y > 335 and mos_y - cam_y < 423 then
game.status = 3 game.status = 5
messages.new_message('cap1preview', 20) messages.new_message('cap1preview', 10)
end end
end end
end end
+2
View File
@@ -54,6 +54,8 @@ function stage3.mousepressed(game, messages, camera)
cam_x, cam_y = camera.gcam:getVisible() cam_x, cam_y = camera.gcam:getVisible()
if mos_x + cam_x > 709 and mos_x + cam_x < 791 and mos_y - cam_y > 202 and mos_y - cam_y < 354 then if mos_x + cam_x > 709 and mos_x + cam_x < 791 and mos_y - cam_y > 202 and mos_y - cam_y < 354 then
game.status = 6 game.status = 6
print 'game.status'
print(game.status)
messages.new_message('cap2stage', 15) messages.new_message('cap2stage', 15)
end end
end end
+42 -4
View File
@@ -6,20 +6,58 @@ local stage4 = {}
local image local image
function stage4.load(game, camera) function stage4.load(game, camera)
image = love.graphics.newImage('assets/sprites/background/fondo_chimenea.jpg') image_libreria = love.graphics.newImage('assets/sprites/chimenea/chimenea.jpg')
stage4.world = { w = image:getWidth(), h= 720} image_libreria_hover = love.graphics.newImage('assets/sprites/chimenea/chimenea_hover.jpg')
image_libreria_none = love.graphics.newImage('assets/sprites/chimenea/chimenea_none.jpg')
stage4.world = { w = image_libreria:getWidth(), h= 720}
game:setNewSizeWorld(stage4.world.w, stage4.world.h) game:setNewSizeWorld(stage4.world.w, stage4.world.h)
arrows.load(game, stage4, camera) arrows.load(game, stage4, camera)
game.canvas.x = game.window.width / 2 game.canvas.x = game.window.width / 2
end end
local count_time = 0
function stage4.update(dt, game) function stage4.update(dt, game)
arrows.update(dt) arrows.update(dt)
if game.status == 6 then
if count_time > 15 then
game.bells_enable = true
game.status = 6
else
count_time = dt + count_time
end
end
end end
function stage4.draw() function stage4.draw(game)
love.graphics.draw(image) local mos_x, mos_y = love.mouse.getPosition()
-- No object
if game.status > 6 then
love.graphics.draw(image_libreria_none)
else
love.graphics.draw(image_libreria)
end
if game.status == 6 then
-- Normal
love.graphics.draw(image_libreria)
-- Hover
cam_x, cam_y = camera.gcam:getVisible()
if mos_x + cam_x > 1050 and mos_x + cam_x < 2000 and mos_y - cam_y > 220 and mos_y - cam_y < 275 then
love.graphics.draw(image_libreria_hover)
end
end
arrows.draw() arrows.draw()
end end
function stage4.mousepressed(game, messages, camera)
local mos_x, mos_y = love.mouse.getPosition()
if game.status == 6 then
cam_x, cam_y = camera.gcam:getVisible()
if mos_x + cam_x > 1050 and mos_x + cam_x < 2000 and mos_y - cam_y > 202 and mos_y - cam_y < 354 then
game.status = 7
messages.new_message('cap3stage', 15)
end
end
end
return stage4 return stage4
+41 -4
View File
@@ -6,20 +6,57 @@ local stage5 = {}
local image local image
function stage5.load(game, camera) function stage5.load(game, camera)
image = love.graphics.newImage('assets/sprites/background/fondo_tocadiscos.jpg') image_tocadiscos = love.graphics.newImage('assets/sprites/tocadiscos/tocadiscos.jpg')
stage5.world = { w = image:getWidth(), h= 720} image_tocadiscos_hover = love.graphics.newImage('assets/sprites/tocadiscos/tocadiscos_hover.jpg')
image_tocadiscos_none = love.graphics.newImage('assets/sprites/tocadiscos/tocadiscos_none.jpg')
stage5.world = { w = image_tocadiscos:getWidth(), h= 720}
game:setNewSizeWorld(stage5.world.w, stage5.world.h) game:setNewSizeWorld(stage5.world.w, stage5.world.h)
arrows.load(game, stage5, camera) arrows.load(game, stage5, camera)
game.canvas.x = game.window.width / 2 game.canvas.x = game.window.width / 2
end end
local count_time = 0
function stage5.update(dt, game) function stage5.update(dt, game)
arrows.update(dt) arrows.update(dt)
if game.status == 7 then
if count_time > 15 then
game.bells_enable = true
game.status = 7
else
count_time = dt + count_time
end
end
end end
function stage5.draw() function stage5.draw(game)
love.graphics.draw(image) local mos_x, mos_y = love.mouse.getPosition()
-- No object
if game.status > 7 then
love.graphics.draw(image_tocadiscos_none)
else
love.graphics.draw(image_tocadiscos)
end
if game.status == 7 then
-- Normal
love.graphics.draw(image_tocadiscos)
-- Hover
cam_x, cam_y = camera.gcam:getVisible()
if mos_x + cam_x > 1005 and mos_x + cam_x < 1150 and mos_y - cam_y > 470 and mos_y - cam_y < 505 then
love.graphics.draw(image_tocadiscos_hover)
end
end
arrows.draw() arrows.draw()
end end
function stage5.mousepressed(game, messages, camera)
local mos_x, mos_y = love.mouse.getPosition()
if game.status == 7 then
cam_x, cam_y = camera.gcam:getVisible()
if mos_x + cam_x > 1005 and mos_x + cam_x < 1150 and mos_y - cam_y > 470 and mos_y - cam_y < 505 then
game.status = 8
messages.new_message('cap4stage', 15)
end
end
end
return stage5 return stage5
+41 -4
View File
@@ -6,20 +6,57 @@ local stage6 = {}
local image local image
function stage6.load(game, camera) function stage6.load(game, camera)
image = love.graphics.newImage('assets/sprites/background/fondo_armario.jpg') image_sujetador = love.graphics.newImage('assets/sprites/sujetador/sujetador.jpg')
stage6.world = { w = image:getWidth(), h= 720} image_sujetador_hover = love.graphics.newImage('assets/sprites/sujetador/sujetador_hover.jpg')
image_sujetador_none = love.graphics.newImage('assets/sprites/sujetador/sujetador_none.jpg')
stage6.world = { w = image_sujetador:getWidth(), h= 720}
game:setNewSizeWorld(stage6.world.w, stage6.world.h) game:setNewSizeWorld(stage6.world.w, stage6.world.h)
arrows.load(game, stage6, camera) arrows.load(game, stage6, camera)
game.canvas.x = game.window.width / 2 game.canvas.x = game.window.width / 2
end end
local count_time = 0
function stage6.update(dt, game) function stage6.update(dt, game)
arrows.update(dt) arrows.update(dt)
if game.status == 8 then
if count_time > 15 then
game.bells_enable = true
game.status = 7
else
count_time = dt + count_time
end
end
end end
function stage6.draw() function stage6.draw(game)
love.graphics.draw(image) local mos_x, mos_y = love.mouse.getPosition()
-- No object
if game.status > 8 then
love.graphics.draw(image_sujetador_none)
else
love.graphics.draw(image_sujetador)
end
if game.status == 8 then
-- Normal
love.graphics.draw(image_sujetador)
-- Hover
cam_x, cam_y = camera.gcam:getVisible()
if mos_x + cam_x > 462 and mos_x + cam_x < 648 and mos_y - cam_y > 165 and mos_y - cam_y < 560 then
love.graphics.draw(image_sujetador_hover)
end
end
arrows.draw() arrows.draw()
end end
function stage6.mousepressed(game, messages, camera)
local mos_x, mos_y = love.mouse.getPosition()
if game.status == 8 then
cam_x, cam_y = camera.gcam:getVisible()
if mos_x + cam_x > 462 and mos_x + cam_x < 648 and mos_y - cam_y > 165 and mos_y - cam_y < 560 then
game.status = 9
messages.new_message('cap5stage', 15)
end
end
end
return stage6 return stage6
+13 -1
View File
@@ -6,11 +6,23 @@ local stage7 = {}
local image local image
function stage7.load(game, camera) function stage7.load(game, camera)
image = love.graphics.newImage('assets/sprites/background/fondo_armario.jpg') if game.status == 9 then
image = love.graphics.newImage('assets/sprites/background/final bueno_3.jpg')
stage7.music = love.audio.newSource("assets/audio/fx/door_win.wav")
stage7.music2 = love.audio.newSource("assets/audio/music/our_song_end.mp3")
else
image = love.graphics.newImage('assets/sprites/background/dead.jpg')
stage7.music = love.audio.newSource("assets/audio/fx/door_lose.wav")
end
game:stopMusic()
stage7.world = { w = image:getWidth(), h= 720} stage7.world = { w = image:getWidth(), h= 720}
game:setNewSizeWorld(stage7.world.w, stage7.world.h) game:setNewSizeWorld(stage7.world.w, stage7.world.h)
arrows.load(game, stage7, camera) arrows.load(game, stage7, camera)
game.canvas.x = game.window.width / 2 game.canvas.x = game.window.width / 2
stage7.music2:play()
stage7.music:play()
end end
function stage7.update(dt, game) function stage7.update(dt, game)
Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

+6
View File
@@ -9,6 +9,9 @@ local start = require 'assets/scripts/start'
local arrows = require 'assets/scripts/arrows' local arrows = require 'assets/scripts/arrows'
local stage2 = require 'assets/scripts/stage2' local stage2 = require 'assets/scripts/stage2'
local stage3 = require 'assets/scripts/stage3' local stage3 = require 'assets/scripts/stage3'
local stage4 = require 'assets/scripts/stage4'
local stage5 = require 'assets/scripts/stage5'
local stage6 = require 'assets/scripts/stage6'
-- LOAD -- LOAD
function love.load() function love.load()
@@ -55,4 +58,7 @@ function love.mousepressed(x, y, button, istouch)
arrows.mousepressed(x, y, button, istouch) arrows.mousepressed(x, y, button, istouch)
stage2.mousepressed(game, messages, camera) stage2.mousepressed(game, messages, camera)
stage3.mousepressed(game, messages, camera) stage3.mousepressed(game, messages, camera)
stage4.mousepressed(game, messages, camera)
stage5.mousepressed(game, messages, camera)
stage6.mousepressed(game, messages, camera)
end end