From 6dc9622bbfa588b84a77616b53cc75bb95b1ba16 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sun, 6 Mar 2016 00:56:05 +0200 Subject: [PATCH] Now with added hud. --- koperkapel/hud.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 koperkapel/hud.py diff --git a/koperkapel/hud.py b/koperkapel/hud.py new file mode 100644 index 0000000..4bce86c --- /dev/null +++ b/koperkapel/hud.py @@ -0,0 +1,29 @@ +""" Roach up display. """ + +from .actors.surf import SurfActor +from .serums import default_serums + + +class HudActor(SurfActor): + def __init__(self, stats, **kw): + self._stats = None + self.stats = stats + super().__init__(surf=self._surf, **kw) + + def _rebuild_hud_surf(self): + smart = default_serums.assemble_icon("smart") + fast = default_serums.assemble_icon("fast") + strong = default_serums.assemble_icon("strong") + health = default_serums.assemble_icon("strong") + return smart + + @property + def stats(self): + return self._stats + + @stats.setter + def stats(self, stats): + if self._stats == stats: + return + self._stats = stats + self.surf = self._rebuild_hud_surf() -- 2.34.1