From: Simon Cross Date: Wed, 2 Mar 2016 20:04:59 +0000 (+0200) Subject: Display roach pads. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=bd8aab701fb1ccd81a3c50661600242024847cad;p=koperkapel.git Display roach pads. --- diff --git a/koperkapel/scenes/roaches.py b/koperkapel/scenes/roaches.py index 923e6fd..7198ee2 100644 --- a/koperkapel/scenes/roaches.py +++ b/koperkapel/scenes/roaches.py @@ -1,7 +1,9 @@ """ Roach management scene. """ from pgzero.constants import keys +from pgzero.actor import Actor from ..actors.buttons import TextButton +from ..constants import WIDTH, HEIGHT from .base import Scene, ChangeSceneEvent @@ -10,8 +12,18 @@ class RoachesScene(Scene): def __init__(self): super().__init__() + self.actors.add_layer("pads", level=5) self.actors.add_layer("roaches", level=10) self._roach_actors = {} + self._init_pads() + + def _init_pads(self): + self._roach_pad = self.actors.add( + Actor("roach_management/roach_pad"), layer="pads") + self._roach_pad.pos = (WIDTH * (7/8), HEIGHT * (1/4)) + self._inventory_pad = self.actors.add( + Actor("roach_management/inventory_pad"), layer="pads") + self._inventory_pad.pos = (WIDTH * (7/8), HEIGHT * (3/4)) def update(self, world, dt): for i, roach in enumerate(world.roaches):