Develop #4
@@ -19,9 +19,17 @@ function arrows.update(dt, game)
|
||||
end
|
||||
|
||||
function arrows.draw()
|
||||
if arrows.game.level > 1 then
|
||||
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
|
||||
|
||||
|
||||
function arrows.mousepressed(mx, my, button)
|
||||
|
||||
@@ -9,7 +9,7 @@ function game.load()
|
||||
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 = 6
|
||||
game.end_level = 7
|
||||
game.start_screen = true
|
||||
|
||||
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.stress = false
|
||||
game.var_end = false
|
||||
|
||||
end
|
||||
|
||||
@@ -34,7 +35,11 @@ function game.update(dt)
|
||||
if game.bells_enable then
|
||||
game:stopMusic()
|
||||
else
|
||||
if game.var_end == false then
|
||||
game:playMusic()
|
||||
else
|
||||
game:stopMusic()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ function stage2.mousepressed(game, messages, camera)
|
||||
if game.status == 2 then
|
||||
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
|
||||
game.status = 3
|
||||
messages.new_message('cap1preview', 20)
|
||||
game.status = 5
|
||||
messages.new_message('cap1preview', 10)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -54,6 +54,8 @@ function stage3.mousepressed(game, messages, camera)
|
||||
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
|
||||
game.status = 6
|
||||
print 'game.status'
|
||||
print(game.status)
|
||||
messages.new_message('cap2stage', 15)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,20 +6,58 @@ local stage4 = {}
|
||||
local image
|
||||
|
||||
function stage4.load(game, camera)
|
||||
image = love.graphics.newImage('assets/sprites/background/fondo_chimenea.jpg')
|
||||
stage4.world = { w = image:getWidth(), h= 720}
|
||||
image_libreria = love.graphics.newImage('assets/sprites/chimenea/chimenea.jpg')
|
||||
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)
|
||||
arrows.load(game, stage4, camera)
|
||||
game.canvas.x = game.window.width / 2
|
||||
end
|
||||
|
||||
local count_time = 0
|
||||
function stage4.update(dt, game)
|
||||
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
|
||||
|
||||
function stage4.draw()
|
||||
love.graphics.draw(image)
|
||||
function stage4.draw(game)
|
||||
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()
|
||||
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
|
||||
|
||||
@@ -6,20 +6,57 @@ local stage5 = {}
|
||||
local image
|
||||
|
||||
function stage5.load(game, camera)
|
||||
image = love.graphics.newImage('assets/sprites/background/fondo_tocadiscos.jpg')
|
||||
stage5.world = { w = image:getWidth(), h= 720}
|
||||
image_tocadiscos = love.graphics.newImage('assets/sprites/tocadiscos/tocadiscos.jpg')
|
||||
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)
|
||||
arrows.load(game, stage5, camera)
|
||||
game.canvas.x = game.window.width / 2
|
||||
end
|
||||
|
||||
local count_time = 0
|
||||
function stage5.update(dt, game)
|
||||
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
|
||||
|
||||
function stage5.draw()
|
||||
love.graphics.draw(image)
|
||||
function stage5.draw(game)
|
||||
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()
|
||||
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
|
||||
|
||||
@@ -6,20 +6,57 @@ local stage6 = {}
|
||||
local image
|
||||
|
||||
function stage6.load(game, camera)
|
||||
image = love.graphics.newImage('assets/sprites/background/fondo_armario.jpg')
|
||||
stage6.world = { w = image:getWidth(), h= 720}
|
||||
image_sujetador = love.graphics.newImage('assets/sprites/sujetador/sujetador.jpg')
|
||||
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)
|
||||
arrows.load(game, stage6, camera)
|
||||
game.canvas.x = game.window.width / 2
|
||||
end
|
||||
|
||||
local count_time = 0
|
||||
function stage6.update(dt, game)
|
||||
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
|
||||
|
||||
function stage6.draw()
|
||||
love.graphics.draw(image)
|
||||
function stage6.draw(game)
|
||||
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()
|
||||
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
|
||||
|
||||
@@ -6,11 +6,23 @@ local stage7 = {}
|
||||
local image
|
||||
|
||||
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}
|
||||
game:setNewSizeWorld(stage7.world.w, stage7.world.h)
|
||||
arrows.load(game, stage7, camera)
|
||||
game.canvas.x = game.window.width / 2
|
||||
stage7.music2:play()
|
||||
stage7.music:play()
|
||||
|
||||
|
||||
end
|
||||
|
||||
function stage7.update(dt, game)
|
||||
|
||||
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 169 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
After Width: | Height: | Size: 160 KiB |
@@ -9,6 +9,9 @@ local start = require 'assets/scripts/start'
|
||||
local arrows = require 'assets/scripts/arrows'
|
||||
local stage2 = require 'assets/scripts/stage2'
|
||||
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
|
||||
function love.load()
|
||||
@@ -55,4 +58,7 @@ function love.mousepressed(x, y, button, istouch)
|
||||
arrows.mousepressed(x, y, button, istouch)
|
||||
stage2.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
|
||||