summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-02-27 15:03:31 +0800
committerEltrac <hi@guhub.cn>2025-02-27 15:03:31 +0800
commit9800e47436233ee68db23b9a2c40aebaca2705d2 (patch)
tree7cd598e7b47470e69bd0cd20336426f250b0b75e /main.lua
parentc5e55465634c8d5cff6cd5ac705b4b833d928486 (diff)
refactor: make player an object
in order to separate player-related game logic and player state management
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.lua b/main.lua
index 12f7257..751565d 100644
--- a/main.lua
+++ b/main.lua
@@ -4,6 +4,7 @@ require "objects.body"
require "objects.room"
require "objects.door"
require "objects.shot"
+require "objects.player"
require "objects.enemy"
require "objects.direction"
require "objects.obstacle"
@@ -53,7 +54,7 @@ function love.update(dt)
entity.update(dt)
end
- if not player.isAlive() then
+ if not G.player:isAlive() then
initGame()
end