From 2947ffd0c112b0646ef4543c845d777cc0cd2623 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 16 Oct 2020 18:20:26 +0200 Subject: [PATCH] Replace # by walls --- dungeonbattle/interfaces.py | 2 +- dungeonbattle/proof_of_concept.py | 8 ++++---- example_map.txt | 34 +++++++++++++++---------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dungeonbattle/interfaces.py b/dungeonbattle/interfaces.py index a312d34..8b107a6 100644 --- a/dungeonbattle/interfaces.py +++ b/dungeonbattle/interfaces.py @@ -49,7 +49,7 @@ class Map: class Tile(Enum): EMPTY = ' ' - WALL = '#' + WALL = '█' FLOOR = '.' def is_wall(self) -> bool: diff --git a/dungeonbattle/proof_of_concept.py b/dungeonbattle/proof_of_concept.py index 2034cbf..9bd2dea 100644 --- a/dungeonbattle/proof_of_concept.py +++ b/dungeonbattle/proof_of_concept.py @@ -1,4 +1,4 @@ -from .interfaces import Map +from .interfaces import Map, Tile from .term_manager import TermManager @@ -19,13 +19,13 @@ def proof_of_concept() -> None: cur = [1, 6] # (y,x) # We are a squirrel - stdscr.addstr(1, 6, '🐿️') + stdscr.addstr(1, 6, '🐿') stdscr.refresh() while True: # Get movements of the user key = stdscr.getkey() - stdscr.addstr(cur[0], cur[1], '.') + stdscr.addstr(cur[0], cur[1], Tile.FLOOR.value) next_pos = cur[:] if key == 'z' or key == 'KEY_UP': next_pos[0] = cur[0] - 1 @@ -42,4 +42,4 @@ def proof_of_concept() -> None: if next_tile.can_walk(): cur = next_pos # Draw the squirrel - stdscr.addstr(cur[0], cur[1], '🐿️') + stdscr.addstr(cur[0], cur[1], '🐿') diff --git a/example_map.txt b/example_map.txt index 4111fae..bc0c464 100644 --- a/example_map.txt +++ b/example_map.txt @@ -1,17 +1,17 @@ - ####### ############# - #.....# #...........# - #.....# #####...........# - #.....# #...............# - #.##### #.###...........# - #.# #.# #...........# - #.# #.# ############# - #.# #.# - #.#### #.# - #....# #.# - ####.###################.# - #.....................# ################# - #.....................# #...............# - #.....................#######...............# - #...........................................# - #.....................#######...............# - ####################### ################# + ███████ █████████████ + █.....█ █...........█ + █.....█ █████...........█ + █.....█ █...............█ + █.█████ █.███...........█ + █.█ █.█ █...........█ + █.█ █.█ █████████████ + █.█ █.█ + █.████ █.█ + █....█ █.█ + ████.███████████████████.█ + █.....................█ █████████████████ + █.....................█ █...............█ + █.....................███████...............█ + █...........................................█ + █.....................███████...............█ + ███████████████████████ █████████████████