From: Simon Cross Date: Sat, 5 Mar 2016 22:56:05 +0000 (+0200) Subject: Now with added hud. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=6dc9622bbfa588b84a77616b53cc75bb95b1ba16;p=koperkapel.git Now with added hud. --- 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()