From: Neil Date: Sat, 5 Mar 2016 10:49:14 +0000 (+0200) Subject: Show the grate X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=99bccc33422efc7e30588087e724ead3a7de7715;p=koperkapel.git Show the grate --- diff --git a/koperkapel/gamelib/tiles.py b/koperkapel/gamelib/tiles.py index 66a74ff..fd47252 100644 --- a/koperkapel/gamelib/tiles.py +++ b/koperkapel/gamelib/tiles.py @@ -60,6 +60,10 @@ class Wall(RandomizedTile): class Underground(RandomizedTile): IMGDIR = "underground" +class Grate(Tile): + IMG = os.path.join('grate', 'grate') + TILESET = 'bunker' + class Tunnel(OrientatedTile): @classmethod diff --git a/koperkapel/loaders/levelloader.py b/koperkapel/loaders/levelloader.py index 4bc24db..0addecc 100644 --- a/koperkapel/loaders/levelloader.py +++ b/koperkapel/loaders/levelloader.py @@ -4,7 +4,7 @@ import json from pgzero.loaders import ResourceLoader -from ..gamelib.tiles import Wall, Floor, Tunnel, Underground +from ..gamelib.tiles import Wall, Floor, Tunnel, Underground, Grate from ..gamelib.level import Level @@ -51,6 +51,10 @@ class LevelLoader(ResourceLoader): neighbors = [x[layer] if x else None for x in neighborhood] tile['%s image' % layer] = \ TILES[tile[layer]['base']].image(neighbors) + # Hack this for now + if layer == 'floor' and 'crawl' in tile[layer]['behaviour']: + print('Here') + tile['floor image'] = Grate.image(neighbors) levels = LevelLoader('levels')