From dc6c7cfd57c294bc9ce87e00a1d7b53d40f134fe Mon Sep 17 00:00:00 2001 From: evilchili Date: Fri, 8 Aug 2025 22:50:08 -0700 Subject: [PATCH] do not draw background tile --- samples/dungeon_test.txt | 24 ++++++++++++------------ src/tilemapper/battlemap.py | 4 +++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/samples/dungeon_test.txt b/samples/dungeon_test.txt index 1b12bcf..4bd5b42 100644 --- a/samples/dungeon_test.txt +++ b/samples/dungeon_test.txt @@ -1,18 +1,18 @@ - + .... - . . + .__. .... - . + . ..... ..... - .,,,........... - .,_,. ..... . - .,,,. ..... . - ..... ..... . ... - . ....... - . ... - . ... - ..... - .___. + .,,,........ + .,_,. ..... + .,,,. ..... + ..... ..... ... + . ... + ............. + . . ... + . ..... + _ .___. .___. .___. ..... diff --git a/src/tilemapper/battlemap.py b/src/tilemapper/battlemap.py index 9cd133c..1aae45e 100644 --- a/src/tilemapper/battlemap.py +++ b/src/tilemapper/battlemap.py @@ -79,7 +79,9 @@ class BattleMap: empty_space = Position(y=-1, x=-1, value=self.tileset.empty_space) for y in range(0, self.height): for x in range(0, self.width): - pos = self.grid.at(y, x, empty_space) + pos = self.grid.at(y, x) + if not pos or pos.value == self.tileset.empty_space: + continue map_image.paste( self.tileset.render_tile(pos, [a or pos for a in self.grid.adjacent(pos)]), (self.tileset.tile_size * x, self.tileset.tile_size * y),