diff options
| author | Eltrac <hi@guhub.cn> | 2025-02-19 11:43:27 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-02-19 11:43:27 +0800 |
| commit | d73e08ba6744a1facb676de6e44033703e6b3a20 (patch) | |
| tree | 2f156fabbfed3c00f98a4e8ef26406f0b50674f4 /main.lua | |
| parent | f45cb21c07cefe58216286bfdafd0c24022b5041 (diff) | |
refactor: put all update functions together
Diffstat (limited to 'main.lua')
| -rw-r--r-- | main.lua | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -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!") |
