Replace # by walls

This commit is contained in:
Yohann D'ANELLO 2020-10-16 18:20:26 +02:00
parent 8818073fc0
commit 2947ffd0c1
3 changed files with 22 additions and 22 deletions

View File

@ -49,7 +49,7 @@ class Map:
class Tile(Enum): class Tile(Enum):
EMPTY = ' ' EMPTY = ' '
WALL = '#' WALL = ''
FLOOR = '.' FLOOR = '.'
def is_wall(self) -> bool: def is_wall(self) -> bool:

View File

@ -1,4 +1,4 @@
from .interfaces import Map from .interfaces import Map, Tile
from .term_manager import TermManager from .term_manager import TermManager
@ -19,13 +19,13 @@ def proof_of_concept() -> None:
cur = [1, 6] # (y,x) cur = [1, 6] # (y,x)
# We are a squirrel # We are a squirrel
stdscr.addstr(1, 6, '🐿') stdscr.addstr(1, 6, '🐿')
stdscr.refresh() stdscr.refresh()
while True: while True:
# Get movements of the user # Get movements of the user
key = stdscr.getkey() key = stdscr.getkey()
stdscr.addstr(cur[0], cur[1], '.') stdscr.addstr(cur[0], cur[1], Tile.FLOOR.value)
next_pos = cur[:] next_pos = cur[:]
if key == 'z' or key == 'KEY_UP': if key == 'z' or key == 'KEY_UP':
next_pos[0] = cur[0] - 1 next_pos[0] = cur[0] - 1
@ -42,4 +42,4 @@ def proof_of_concept() -> None:
if next_tile.can_walk(): if next_tile.can_walk():
cur = next_pos cur = next_pos
# Draw the squirrel # Draw the squirrel
stdscr.addstr(cur[0], cur[1], '🐿') stdscr.addstr(cur[0], cur[1], '🐿')

View File

@ -1,17 +1,17 @@
####### ############# ███████ █████████████
#.....# #...........# █.....█ █...........█
#.....# #####...........# █.....█ █████...........█
#.....# #...............# █.....█ █...............█
#.##### #.###...........# █.█████ █.███...........█
#.# #.# #...........# █.█ █.█ █...........█
#.# #.# ############# █.█ █.█ █████████████
#.# #.# █.█ █.█
#.#### #.# █.████ █.█
#....# #.# █....█ █.█
####.###################.# ████.███████████████████.█
#.....................# ################# █.....................█ █████████████████
#.....................# #...............# █.....................█ █...............█
#.....................#######...............# █.....................███████...............█
#...........................................# █...........................................█
#.....................#######...............# █.....................███████...............█
####################### ################# ███████████████████████ █████████████████