summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-02-19 11:43:27 +0800
committerEltrac <hi@guhub.cn>2025-02-19 11:43:27 +0800
commitd73e08ba6744a1facb676de6e44033703e6b3a20 (patch)
tree2f156fabbfed3c00f98a4e8ef26406f0b50674f4 /main.lua
parentf45cb21c07cefe58216286bfdafd0c24022b5041 (diff)
refactor: put all update functions together
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua16
1 files changed, 4 insertions, 12 deletions
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!")