Very crudely hack vehicles into the level
[koperkapel.git] / koperkapel / vehicles / walking.py
index 9c19aa2264e7f730e0a4ea303b4c7e5310944848..aa88bc65a97230d5048f01927e43b4cddcdfbc1c 100644 (file)
@@ -2,7 +2,7 @@
 
 import math
 from .base import Vehicle, Seat
-
+from ..roaches import default_roaches, roaches_quartet, roaches_nonet, WorldRoach
 
 class Walking(Vehicle):
 
@@ -17,3 +17,20 @@ class Walking(Vehicle):
                 pos=(math.sin(i * d_theta), math.cos(i * d_theta)))
             for i in range(n_seats)
         ]
+
+    def get_avatar(self, world):
+        num_roaches = len(world.roaches)
+        roach = WorldRoach()
+        if num_roaches == 1:
+            # Return a single large roach
+            avatar = default_roaches.assemble(roach)
+            avatar.anchor = (0, 0)
+        elif num_roaches < 6:
+            avatar = roaches_quartet.assemble(roach)
+            avatar.anchor = (-16, 0)
+        else:
+            avatar = roaches_nonet.assemble(roach)
+        return avatar
+
+    def changed(self):
+        return False