Develop #4
@@ -4,7 +4,7 @@ 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 }
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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: 195 KiB After Width: | Height: | Size: 189 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 85 KiB |
Reference in New Issue
Block a user