Develop #4
@@ -22,10 +22,8 @@ function arrows.draw()
|
|||||||
if arrows.game.level > 1 then
|
if arrows.game.level > 1 then
|
||||||
love.graphics.draw(arrows.img_left, arrows.left_x, arrows.left_y)
|
love.graphics.draw(arrows.img_left, arrows.left_x, arrows.left_y)
|
||||||
end
|
end
|
||||||
if arrows.game.level ~= arrows.game.end_level then
|
|
||||||
love.graphics.draw(arrows.img_right, arrows.right_x, arrows.right_y)
|
love.graphics.draw(arrows.img_right, arrows.right_x, arrows.right_y)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function love.mousepressed(mx, my, button)
|
function love.mousepressed(mx, my, button)
|
||||||
@@ -47,12 +45,7 @@ function love.mousepressed(mx, my, button)
|
|||||||
end
|
end
|
||||||
if same_size then
|
if same_size then
|
||||||
-- canvas == world
|
-- canvas == world
|
||||||
|
|
||||||
print 'x'
|
|
||||||
if mx >= arrows.right_x then
|
if mx >= arrows.right_x then
|
||||||
print 'y'
|
|
||||||
print(my)
|
|
||||||
print(arrows.right_y)
|
|
||||||
if my >= arrows.left_y and my < arrows.left_y + arrows.img_left:getHeight() then
|
if my >= arrows.left_y and my < arrows.left_y + arrows.img_left:getHeight() then
|
||||||
arrows.game:nextLevel()
|
arrows.game:nextLevel()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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 = 8
|
game.end_level = 6
|
||||||
|
|
||||||
love.window.setMode(game.window.width, game.window.height)
|
love.window.setMode(game.window.width, game.window.height)
|
||||||
|
|
||||||
@@ -30,7 +30,11 @@ function game.load()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function game:nextLevel()
|
function game:nextLevel()
|
||||||
game.level = game.level + 1
|
if game.level == game.end_level then
|
||||||
|
game.level = 1
|
||||||
|
else
|
||||||
|
game.level = game.level + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function game:prevLevel()
|
function game:prevLevel()
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local stage1 = {}
|
|||||||
local image
|
local image
|
||||||
|
|
||||||
function stage1.load(game, camera)
|
function stage1.load(game, camera)
|
||||||
image = love.graphics.newImage('assets/sprites/background/fondo_libros.jpg')
|
image = love.graphics.newImage('assets/sprites/background/fondo_puerta.jpg')
|
||||||
stage1.world = { w = image:getWidth(), h= 720}
|
stage1.world = { w = image:getWidth(), h= 720}
|
||||||
game:setNewSizeWorld(stage1.world.w, stage1.world.h)
|
game:setNewSizeWorld(stage1.world.w, stage1.world.h)
|
||||||
arrows.load(game, stage1, camera)
|
arrows.load(game, stage1, camera)
|
||||||
|
|||||||
@@ -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/fondo_tocadiscos.jpg')
|
image = love.graphics.newImage('assets/sprites/background/fondo_mesilla.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)
|
||||||
|
|||||||
@@ -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/fondo_vacio.jpg')
|
image = love.graphics.newImage('assets/sprites/background/fondo_libros.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)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local stage4 = {}
|
|||||||
local image
|
local image
|
||||||
|
|
||||||
function stage4.load(game, camera)
|
function stage4.load(game, camera)
|
||||||
image = love.graphics.newImage('assets/sprites/background/fondo_mesilla.jpg')
|
image = love.graphics.newImage('assets/sprites/background/fondo_chimenea.jpg')
|
||||||
stage4.world = { w = image:getWidth(), h= 720}
|
stage4.world = { w = image: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)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local stage5 = {}
|
|||||||
local image
|
local image
|
||||||
|
|
||||||
function stage5.load(game, camera)
|
function stage5.load(game, camera)
|
||||||
image = love.graphics.newImage('assets/sprites/background/fondo_puerta.jpg')
|
image = love.graphics.newImage('assets/sprites/background/fondo_tocadiscos.jpg')
|
||||||
stage5.world = { w = image:getWidth(), h= 720}
|
stage5.world = { w = image: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)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local stage6 = {}
|
|||||||
local image
|
local image
|
||||||
|
|
||||||
function stage6.load(game, camera)
|
function stage6.load(game, camera)
|
||||||
image = love.graphics.newImage('assets/sprites/background/fondo_chimenea.jpg')
|
image = love.graphics.newImage('assets/sprites/background/fondo_armario.jpg')
|
||||||
stage6.world = { w = image:getWidth(), h= 720}
|
stage6.world = { w = image: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)
|
||||||
|
|||||||
Reference in New Issue
Block a user