Now with added hud.
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 22:56:05 +0000 (00:56 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 22:56:05 +0000 (00:56 +0200)
koperkapel/hud.py [new file with mode: 0644]

diff --git a/koperkapel/hud.py b/koperkapel/hud.py
new file mode 100644 (file)
index 0000000..4bce86c
--- /dev/null
@@ -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()