summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-13 00:29:22 +0800
committerEltrac <hi@guhub.cn>2025-03-13 00:29:22 +0800
commita46017a963e2f14894463ae5525429cc7612c99c (patch)
tree8717758879ab62557f40b475f501d065c8c6a891 /main.lua
parent8feb250231335a90d358f0ebdd53c4f29df60831 (diff)
refactor: move room switch trigger to door contact
due to the requirement for adding doors and door bodies before initializing body lifecycle manager, move lifecycle manager to game initialization and create more bodies with this manager
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index e46b29f..4175715 100644
--- a/main.lua
+++ b/main.lua
@@ -4,11 +4,11 @@ require "render.sprite"
require "render.speaker"
local audio = require "utils.audio"
local map = require "logic.map"
-local bodyLifeCycleManager = require "utils.bodyLifecycleManager"
local controller = require "logic.controller"
local translator = require "i18n.translator"
function love.load()
+ G = {}
-- load font
local myFont = love.graphics.newFont("resources/fonts/MZPXflat.ttf", 17)
love.graphics.setFont(myFont)
@@ -24,8 +24,6 @@ function love.load()
-- initialize game state
initGame()
- -- body life cycle manager
- G.BodyLifeCycleManager = bodyLifeCycleManager.new()
-- set world callbacks
G.world:setCallbacks(onContact)