From 8b69034db039c03a007a04bbc5bac58d426058c2 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 11 Mar 2025 10:09:32 +0800 Subject: refactor: object updates itself with :update() function --- main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 31b5982..ef8135c 100644 --- a/main.lua +++ b/main.lua @@ -52,11 +52,13 @@ end local controller = require "logic.controller" function love.update(dt) - local updates = { player, enemies, bullets, loot, map, controller, speaker } + local updates = { player, map, controller, speaker } for _, entity in ipairs(updates) do entity.update(dt) end + G.currentRoom:update(dt) + if not G.player:isAlive() then initGame() end -- cgit v1.2.3