Add ladders in the map

This commit is contained in:
Yohann D'ANELLO 2020-12-26 00:52:47 +01:00
parent ad5ae22e5f
commit 8636d571b5
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
4 changed files with 13 additions and 4 deletions

View File

@ -1,8 +1,8 @@
1 6
####### #############
#.....# #...........#
#.H...# #...........#
#.....# #####...........#
#.....# #...............#
#.....# #............H..#
#.##### #.###...........#
#.# #.# #...........#
#.# #.# #############

View File

@ -1,6 +1,6 @@
1 17
########### #########
#.........# #.......#
#....H....# #.......#
#.........# ############.......#
#.........###############..........#.......##############
#.........#........................#....................#
@ -13,7 +13,7 @@
########.##########......# #.........# #.........#
#...........##......# #.........# #.........#
#...........##......# #.........# #.........#
#...........##......# #.........# ################.######
#...........##..H...# #.........# ################.######
#...........##......# #.........# #.................############
#...........##......# ########.########.......#.........#..........#
#...........##......# #...............#.......#.........#..........#

View File

@ -64,6 +64,7 @@ TexturePack.ASCII_PACK = TexturePack(
EMPTY=' ',
EXPLOSION='%',
FLOOR='.',
LADDER='H',
HAZELNUT='¤',
HEART='',
HEDGEHOG='*',
@ -90,6 +91,7 @@ TexturePack.SQUIRREL_PACK = TexturePack(
EMPTY=' ',
EXPLOSION='💥',
FLOOR='██',
LADDER='🪜',
HAZELNUT='🌰',
HEART='💜',
HEDGEHOG='🦔',

View File

@ -198,6 +198,7 @@ class Tile(Enum):
EMPTY = auto()
WALL = auto()
FLOOR = auto()
LADDER = auto()
@staticmethod
def from_ascii_char(ch: str) -> "Tile":
@ -222,6 +223,12 @@ class Tile(Enum):
"""
return self == Tile.WALL
def is_ladder(self) -> bool:
"""
Is this Tile a ladder?
"""
return self == Tile.LADDER
def can_walk(self) -> bool:
"""
Check if an entity (player or not) can move in this tile.