From e9ca10ba97bd24a424bffb065918418944514f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20N=C3=B6llemeyer?= Date: Sun, 18 Aug 2024 13:58:09 +0200 Subject: [PATCH] add hp --- game/components.py | 3 +++ game/screens/game_screens.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/game/components.py b/game/components.py index 05554e5..ed76117 100644 --- a/game/components.py +++ b/game/components.py @@ -70,3 +70,6 @@ Action: Final = ("Action", Callable[[Entity], None]) Gold: Final = ("Gold", int) """Amount of gold.""" + +HP: Final = ("Health", int) +"""How alive an entity is""" diff --git a/game/screens/game_screens.py b/game/screens/game_screens.py index 27cb844..eb2445d 100644 --- a/game/screens/game_screens.py +++ b/game/screens/game_screens.py @@ -96,7 +96,7 @@ class MainScreen(Screen): map: Map = g.world[None].components[Map] - # Draw walls + # Draw walls and floors doors = [ d.components[Position] for d in g.world.Q.all_of(tags=[IsDoor]) ] for i in range(console.width): for j in range(console.height):