From d73e08ba6744a1facb676de6e44033703e6b3a20 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Wed, 19 Feb 2025 11:43:27 +0800 Subject: refactor: put all update functions together --- main.lua | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 4b1650c..9fd035d 100644 --- a/main.lua +++ b/main.lua @@ -37,18 +37,10 @@ function love.load() end function love.update(dt) - player.move(dt) - player.entering() - - enemies.move(dt) - - bullets.update(dt) - - player.beingAttacked() - enemies.beingShot() - loot.beingPicked() - - map.update() + local updates = { player, enemies, bullets, loot, map } + for _, entity in ipairs(updates) do + entity.update(dt) + end if not player.isAlive() then print("Out of hearts. You died!") -- cgit v1.2.3