From 71d1f6e929c1d7498eb8e51b8b41faefacc79ff6 Mon Sep 17 00:00:00 2001 From: Simon Kellet Date: Mon, 22 Jul 2024 23:29:16 +0100 Subject: [PATCH] changed --- main.lua | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/main.lua b/main.lua index 50488fa..75a4d51 100644 --- a/main.lua +++ b/main.lua @@ -10,6 +10,12 @@ World:addCollisionClass("Player2") World:addCollisionClass("Bullet2") World:addCollisionClass("Wall") +--Fonts used in the game +GameFont = love.graphics.newFont("assets/Daydream.ttf", 60) +DebugFont = love.graphics.newFont("assets/Daydream.ttf", 12) +MenuFont = love.graphics.newFont("assets/Daydream.ttf", 45) +Walls = {} + function love.run() if love.load then love.load(love.arg.parseGameArguments(arg), arg) @@ -86,10 +92,8 @@ function love.load() require("Pause/PauseKeyPressed") require("Win/WinKeyPressed") - --Fonts used in the game - GameFont = love.graphics.newFont("assets/Daydream.ttf", 60) - DebugFont = love.graphics.newFont("assets/Daydream.ttf", 12) - MenuFont = love.graphics.newFont("assets/Daydream.ttf", 45) + -- Set a random seed + love.math.setRandomSeed(love.timer.getTime()) --Game consts HEALTH = 3 @@ -99,8 +103,6 @@ function love.load() Bullets1 = {} Bullets2 = {} - Walls = {} - DebugFlag = false EnableKeyPress1 = true KeyPressTime1 = 0 @@ -127,7 +129,7 @@ function love.load() }) --STI Map loading - LoadMap(1) + LoadMap(_G.CUR_LEVEL) end function love.keypressed(key) @@ -158,8 +160,8 @@ function love.update(dt) UpdatePause(dt) -- Handle music if not musicPause:isPlaying() then - --musicBattle:setVolume(0) - --musicPause:setVolume(0.5) + musicBattle:setVolume(0) + musicPause:setVolume(0.5) love.audio.play(musicBattle) love.audio.play(musicPause) end @@ -168,8 +170,8 @@ function love.update(dt) UpdateGame(dt) -- Handle music if not musicBattle:isPlaying() then - --musicBattle:setVolume(0.5) - --musicPause:setVolume(0) + musicBattle:setVolume(0.5) + musicPause:setVolume(0) love.audio.play(musicBattle) love.audio.play(musicPause) end