From: Simon Cross Date: Sat, 5 Mar 2016 11:07:43 +0000 (+0200) Subject: Merge branch 'master' of ctpug.org.za:koperkapel X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=0dc9a8b725a625cc444eb1b49ebf2f9cf00b0539;hp=2c4c2428ac247ea8fdac2aaf6b2373fbf0275e3c;p=koperkapel.git Merge branch 'master' of ctpug.org.za:koperkapel --- 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/images/Makefile b/koperkapel/images/Makefile index 3cac620..c2ea50e 100644 --- a/koperkapel/images/Makefile +++ b/koperkapel/images/Makefile @@ -2,13 +2,13 @@ VPATH=../../sources # Vector tiles -TILE_DIRS=roach serum vehicle_tiles +TILE_DIRS=roach serum vehicle_tiles fixtures TILE_SVGS=$(shell find $(patsubst %, $(VPATH)/vector/%, $(TILE_DIRS)) -name "*.svg") TILE_PNGS=$(patsubst $(VPATH)/vector/%.svg, %.png, $(TILE_SVGS)) # Bitmap tiles -BTILE_DIRS=wall floor tunnel underground +BTILE_DIRS=wall floor tunnel underground grate BTILE_SRC=$(shell find $(patsubst %, $(VPATH)/bitmap/%, $(BTILE_DIRS)) -name "*.png") BTILE_PNGS=$(patsubst $(VPATH)/bitmap/%, bunker/%, $(BTILE_SRC)) diff --git a/koperkapel/images/bunker/grate/grate.png b/koperkapel/images/bunker/grate/grate.png new file mode 100644 index 0000000..c652922 Binary files /dev/null and b/koperkapel/images/bunker/grate/grate.png differ diff --git a/koperkapel/images/fixtures/grate.png b/koperkapel/images/fixtures/grate.png new file mode 100644 index 0000000..41eb3f8 Binary files /dev/null and b/koperkapel/images/fixtures/grate.png differ diff --git a/koperkapel/images/fixtures/grate_circle.png b/koperkapel/images/fixtures/grate_circle.png new file mode 100644 index 0000000..369fe31 Binary files /dev/null and b/koperkapel/images/fixtures/grate_circle.png differ 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') diff --git a/sources/bitmap/grate/grate.png b/sources/bitmap/grate/grate.png new file mode 100644 index 0000000..9743b26 Binary files /dev/null and b/sources/bitmap/grate/grate.png differ diff --git a/sources/vector/fixtures/grate.svg b/sources/vector/fixtures/grate.svg new file mode 100644 index 0000000..9fc5ce8 --- /dev/null +++ b/sources/vector/fixtures/grate.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/sources/vector/fixtures/grate_circle.svg b/sources/vector/fixtures/grate_circle.svg new file mode 100644 index 0000000..023d40b --- /dev/null +++ b/sources/vector/fixtures/grate_circle.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + +