Develop #4
@@ -1,4 +1,5 @@
|
||||
local game = {}
|
||||
local gamera = require 'assets/scripts/vendor/gamera'
|
||||
|
||||
function game.load()
|
||||
-- Configuration
|
||||
@@ -33,4 +34,12 @@ function game:prevLevel()
|
||||
game.level = game.level - 1
|
||||
end
|
||||
|
||||
function game:setNewSizeWorld(canvas_width, canvas_height)
|
||||
local width, height = 1280, 720
|
||||
game.window = { width = width , height = height }
|
||||
game.canvas = { x = width / 2, y= 0, width = canvas_width, height = canvas_height }
|
||||
camera.gcam = gamera.new(0, 0, game.window.width, game.window.height)
|
||||
camera.gcam:setWorld(0, 0, game.canvas.width, game.canvas.height)
|
||||
end
|
||||
|
||||
return game
|
||||
|
||||
@@ -6,6 +6,8 @@ local stage1 = {}
|
||||
local image
|
||||
|
||||
function stage1.load(game, camera)
|
||||
stage1.world = { w = 2560, h= 720}
|
||||
game:setNewSizeWorld(stage1.world.w, stage1.world.h)
|
||||
image = love.graphics.newImage('assets/sprites/background/bg.jpg')
|
||||
arrows.load(game, stage1, camera)
|
||||
game.canvas.x = game.window.width
|
||||
|
||||
@@ -6,6 +6,8 @@ local stage2 = {}
|
||||
local image
|
||||
|
||||
function stage2.load(game, camera)
|
||||
stage2.world = { w = 2280, h= 720}
|
||||
game:setNewSizeWorld(stage2.world.w, stage2.world.h)
|
||||
image = love.graphics.newImage('assets/sprites/background/bg2.jpg')
|
||||
arrows.load(game, stage2, camera)
|
||||
game.canvas.x = game.canvas.width / 2
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 81 KiB |
Reference in New Issue
Block a user