From: Neil Date: Sat, 10 Sep 2016 11:27:00 +0000 (+0200) Subject: Add Boyd's spawn position to stations X-Git-Tag: tabakrolletjie-v1.0.0~120^2~1 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=7fe679f0d81d81b6bc3b8dc20d4b0a62840144f3;p=tabakrolletjie.git Add Boyd's spawn position to stations --- diff --git a/data/stations/station-alpha.json b/data/stations/station-alpha.json index f0e27e5..07f23e9 100644 --- a/data/stations/station-alpha.json +++ b/data/stations/station-alpha.json @@ -2,6 +2,7 @@ "config": { "name": "Station Alpha", "power": 100, + "spawn positions": [[275, 300]], "seeds": 10 }, "obstacles": [ diff --git a/data/stations/station-beta.json b/data/stations/station-beta.json index ae16cff..8273a5c 100644 --- a/data/stations/station-beta.json +++ b/data/stations/station-beta.json @@ -2,6 +2,7 @@ "config": { "name": "Station Beta", "power": 100, + "spawn positions": [[25, 400], [1000, 410]], "seeds": 100 }, "obstacles": [ diff --git a/tabakrolletjie/enemies.py b/tabakrolletjie/enemies.py index eef2596..422b103 100644 --- a/tabakrolletjie/enemies.py +++ b/tabakrolletjie/enemies.py @@ -138,8 +138,10 @@ class Mould(pymunk.Body): class Boyd(object): def __init__(self, gamestate, space): - seed = Mould(gamestate, space, (275, 300)) - self._moulds = [seed] + self._moulds = [] + for position in gamestate.get_spawn_positions(): + seed = Mould(gamestate, space, position) + self._moulds.append(seed) self._image = pygame.surface.Surface(SCREEN_SIZE) self._image = self._image.convert_alpha(pygame.display.get_surface()) self._draw_moulds() diff --git a/tabakrolletjie/gamestate.py b/tabakrolletjie/gamestate.py index 091b709..c678bef 100644 --- a/tabakrolletjie/gamestate.py +++ b/tabakrolletjie/gamestate.py @@ -40,3 +40,6 @@ class GameState(object): def load_station(self, station): self._state["station"] = loader.load_station(station) + + def get_spawn_positions(self): + return self._state["station"]["config"]["spawn positions"]