From b352f1425bd73d0cdc371789296c43396e4f565b Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 4 Mar 2016 00:37:09 +0200 Subject: [PATCH] Vague sketch of displaying vehicle in roach management scene. --- koperkapel/scenes/roaches.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/koperkapel/scenes/roaches.py b/koperkapel/scenes/roaches.py index 34f0267..342f23c 100644 --- a/koperkapel/scenes/roaches.py +++ b/koperkapel/scenes/roaches.py @@ -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( -- 2.34.1