Return to repo list

tzed

Simple story-driven open world 2D CRPG.
Return to HMagellan.com

commit 3e4a6f09dc9a7d3e0a9a5b4053a3ae6cf21776f5
parent 8c25b9759cf05f1d77cab1a3ddec66a9460d49ee
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Mon, 14 Jun 2021 20:09:53 -0500

now draw exit overlay

Diffstat:
Mdata/boards/test_town/overlay.json | 4+++-
Mdata/boards/test_town/test_town.tmx | 4++--
Mdata/img/overlay.png | 0
Msrc/entity.py | 3++-
4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/data/boards/test_town/overlay.json b/data/boards/test_town/overlay.json @@ -1,7 +1,9 @@ { "exits": { "test_ow" : { - "north" : [ [3, 0], [4, 0], [5, 0] ] + "north" : [ [3, 0], [4, 0], [5, 0] ], + "west" : [ [0, 3], [0, 4], [0, 5] ], + "south" : [ [7, 11], [8, 11], [9, 11] ] } } } diff --git a/data/boards/test_town/test_town.tmx b/data/boards/test_town/test_town.tmx @@ -7,8 +7,8 @@ 81,81,92,32,51,14,91,11,11,11,11,11, 73,76,74,32,51,14,117,115,118,115,122,115, 13,51,13,52,51,52,13,13,51,16,1,29, -51,51,51,51,51,51,51,51,51,14,2,2, -31,94,102,95,77,95,93,51,51,14,1,1, +51,51,51,51,51,51,51,51,51,14,2,9, +31,94,102,95,77,95,93,51,51,14,1,2, 1,91,81,81,81,81,92,32,51,14,1,21, 10,91,81,81,81,81,92,32,51,14,1,5, 27,91,81,81,81,81,92,32,51,14,1,5, diff --git a/data/img/overlay.png b/data/img/overlay.png Binary files differ. diff --git a/src/entity.py b/src/entity.py @@ -66,13 +66,14 @@ class EntityManager(manager.Manager): # Populate the overlay self.board_overlay = pygame.sprite.LayeredDirty() + d = { "north" : (0, 0), "east" : (1, 0), "south" : (0, 1), "west" : (1, 1) } sh = self.system_bus.fetch("sheet_system", "sheets") for oc in overlay_data: if oc == "exits": for t in overlay_data[oc]: for o in overlay_data[oc][t]: for oo in overlay_data[oc][t][o]: - noe = OverlayEntity(sh["overlay"], (0, 0), None, False, "exit_" + t) + noe = OverlayEntity(sh["overlay"], d[o], None, False, "exit_" + o) noe.assign_tile(tuple(oo), self.bus.perform_board_manager_get_tile_at_tile_pos(tuple(oo))) noe.snap_to_tile() self.board_overlay.add(noe)