Vague sketch of displaying vehicle in roach management scene.
authorSimon Cross <hodgestar@gmail.com>
Thu, 3 Mar 2016 22:37:09 +0000 (00:37 +0200)
committerSimon Cross <hodgestar@gmail.com>
Thu, 3 Mar 2016 22:37:09 +0000 (00:37 +0200)
koperkapel/scenes/roaches.py

index 34f02679c5ed5807f6af13ef6e1d9a8e3490d520..342f23cd2a57a592cfe4c3600a33a631b83addb7 100644 (file)
@@ -4,6 +4,7 @@ from pgzero.constants import keys, mouse
 from pgzero.actor import Actor
 from ..actors.buttons import TextButton, ImageButton
 from ..constants import WIDTH, HEIGHT
+from ..vehicles.base import Vehicle
 from .base import Scene, ChangeSceneEvent
 
 
@@ -28,12 +29,21 @@ class RoachesScene(Scene):
         self._roaches = self.actors.add_layer("roaches", level=10)
         self._pads = self.actors.add_layer("pads", level=5)
         self._buttons = self.actors.add_layer("buttons", level=6)
-        self._init_bg()
         self._init_pads()
         self._init_buttons()
 
+    def enter(self, world):
+        self._vehicle = Vehicle.by_type(world.vehicles.current)
+        self._init_bg()
+        self._init_seats()
+
     def _init_bg(self):
         self.actors.default.add(Actor("vehicles/walking/background"))
+        self.actors.default.add(self._vehicle.background)
+
+    def _init_seats(self):
+        print("Seats:")
+        print([seat.pos for seat in self._vehicle.seats])
 
     def _init_pads(self):
         self._roach_pad = self._pads.add(