From: Simon Cross Date: Thu, 3 Mar 2016 22:37:09 +0000 (+0200) Subject: Vague sketch of displaying vehicle in roach management scene. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=b352f1425bd73d0cdc371789296c43396e4f565b;p=koperkapel.git Vague sketch of displaying vehicle in roach management scene. --- 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(