Develop #4
+15
-1
@@ -20,7 +20,13 @@ function game.load()
|
|||||||
game.world = love.physics.newWorld(0, gravity * world_meter, true) -- Make earth
|
game.world = love.physics.newWorld(0, gravity * world_meter, true) -- Make earth
|
||||||
|
|
||||||
-- Bells
|
-- Bells
|
||||||
bells_enable = false
|
bells_enable = true
|
||||||
|
|
||||||
|
game.music = love.audio.newSource("assets/audio/music/theme.mp3")
|
||||||
|
game:playMusic()
|
||||||
|
|
||||||
|
game.stress = false
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function game:nextLevel()
|
function game:nextLevel()
|
||||||
@@ -39,4 +45,12 @@ function game:setNewSizeWorld(canvas_width, canvas_height)
|
|||||||
camera.gcam:setWorld(0, 0, game.canvas.width, game.canvas.height)
|
camera.gcam:setWorld(0, 0, game.canvas.width, game.canvas.height)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function game:playMusic()
|
||||||
|
game.music:play()
|
||||||
|
end
|
||||||
|
|
||||||
|
function game:stopMusic()
|
||||||
|
game.music:stop()
|
||||||
|
end
|
||||||
|
|
||||||
return game
|
return game
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ local stage2 = {}
|
|||||||
local image
|
local image
|
||||||
|
|
||||||
function stage2.load(game, camera)
|
function stage2.load(game, camera)
|
||||||
stage2.world = { w = 2280, h= 720}
|
image = love.graphics.newImage('assets/sprites/background/santabiblia.jpg')
|
||||||
|
stage2.world = { w = image:getWidth(), h= 720}
|
||||||
game:setNewSizeWorld(stage2.world.w, stage2.world.h)
|
game:setNewSizeWorld(stage2.world.w, stage2.world.h)
|
||||||
image = love.graphics.newImage('assets/sprites/background/bg2.jpg')
|
|
||||||
arrows.load(game, stage2, camera)
|
arrows.load(game, stage2, camera)
|
||||||
game.canvas.x = game.canvas.width / 2
|
game.canvas.x = game.window.width / 2
|
||||||
end
|
end
|
||||||
|
|
||||||
function stage2.update(dt, game)
|
function stage2.update(dt, game)
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
local anim8 = require 'assets/scripts/vendor/anim8'
|
||||||
|
local tools = require 'assets/scripts/tools'
|
||||||
|
local arrows = require 'assets/scripts/arrows'
|
||||||
|
|
||||||
|
local stress = {}
|
||||||
|
local image
|
||||||
|
|
||||||
|
function stress.load(game, camera)
|
||||||
|
image = love.graphics.newImage('assets/sprites/stress/stress.png')
|
||||||
|
end
|
||||||
|
|
||||||
|
function stress.update(dt, game)
|
||||||
|
stress.stress = game.stress
|
||||||
|
arrows.update(dt)
|
||||||
|
end
|
||||||
|
|
||||||
|
function stress.draw()
|
||||||
|
if stress.stress == true then
|
||||||
|
cam_x, cam_y = camera.gcam:getVisible()
|
||||||
|
love.graphics.draw(image, cam_x, cam_y)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return stress
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
@@ -3,14 +3,15 @@ local stages = require 'assets/scripts/stages'
|
|||||||
local controls = require 'assets/scripts/controls'
|
local controls = require 'assets/scripts/controls'
|
||||||
local bells = require 'assets/scripts/bells'
|
local bells = require 'assets/scripts/bells'
|
||||||
local camera = require 'assets/scripts/camera'
|
local camera = require 'assets/scripts/camera'
|
||||||
|
local stress = require 'assets/scripts/stress'
|
||||||
|
|
||||||
-- LOAD
|
-- LOAD
|
||||||
function love.load()
|
function love.load()
|
||||||
game.load()
|
game.load()
|
||||||
camera.load(game)
|
camera.load(game)
|
||||||
stages.load(game, camera)
|
stages.load(game, camera)
|
||||||
bells.load(game, camera)
|
stress.load(game, camera)
|
||||||
|
--bells.load(game, camera)
|
||||||
controls.load(game)
|
controls.load(game)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -20,7 +21,8 @@ function love.update(dt)
|
|||||||
game.world:update(dt)
|
game.world:update(dt)
|
||||||
camera.update(game)
|
camera.update(game)
|
||||||
stages.update(dt, game, camera)
|
stages.update(dt, game, camera)
|
||||||
bells.update(dt, game, camera)
|
stress.update(dt, game, camera)
|
||||||
|
-- bells.update(dt, game, camera)
|
||||||
controls.update(dt, game, camera)
|
controls.update(dt, game, camera)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -29,7 +31,8 @@ function love.draw()
|
|||||||
camera.gcam:draw(
|
camera.gcam:draw(
|
||||||
function(l,t,w,h)
|
function(l,t,w,h)
|
||||||
stages.draw()
|
stages.draw()
|
||||||
bells.draw(game)
|
stress.draw()
|
||||||
|
-- bells.draw(game)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
controls.draw()
|
controls.draw()
|
||||||
|
|||||||
Reference in New Issue
Block a user