From 5a7224aaadb4127708c9a10d15e90fe92052d2ce Mon Sep 17 00:00:00 2001 From: Fred Z Date: Thu, 5 Apr 2018 18:29:42 +0200 Subject: [PATCH] Renames 'void' element by 'floor' --- conf.py | 2 +- maze.py | 6 +++--- player.py | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/conf.py b/conf.py index a993cb8..3c71727 100644 --- a/conf.py +++ b/conf.py @@ -17,7 +17,7 @@ ELEMENTS = ( 'tile': 'img/ether.png'}, {'symbol': 'E', 'name': 'exit', 'cross': False, 'item': False, 'tile': 'img/guardian.png'}, - {'symbol': ' ', 'name': 'void', 'cross': True, 'item': False, + {'symbol': ' ', 'name': 'floor', 'cross': True, 'item': False, 'tile': 'img/floor1.png'}, {'symbol': '.', 'name': 'wall', 'cross': False, 'item': False, 'tile': 'img/wall.png'}, diff --git a/maze.py b/maze.py index da53fd9..a299546 100644 --- a/maze.py +++ b/maze.py @@ -51,7 +51,7 @@ class Maze: for symbol_to_place in elmt_val('symbol', 'item', True): position = random.choice( [idx for (idx, value) in enumerate(self.string) - if value == elmt_val('symbol', 'name', 'void', 0)] + if value == elmt_val('symbol', 'name', 'floor', 0)] ) self.set_symbol(symbol_to_place, position) @@ -91,7 +91,7 @@ class Maze: if differance < 0: return line[:MAZE_SIZE] elif differance > 0: - return line + (differance * elmt_val('symbol', 'name', 'void', 0)) + return line + (differance * elmt_val('symbol', 'name', 'floor', 0)) else: return line @@ -99,7 +99,7 @@ class Maze: """ Set an symbol on the maze - Used for 'player' and 'void' after collecting items + Used for 'player' and 'floor' after collecting items :param str symbol: the symbol to set :param str pos: index in the string diff --git a/player.py b/player.py index b661729..a54a93c 100644 --- a/player.py +++ b/player.py @@ -23,8 +23,8 @@ class Player: self.position = maze.string.find( elmt_val('symbol', 'name', 'player', 0) ) - # Element under player, default 'void' - self.ground = elmt_val('symbol', 'name', 'void', 0) + # Element under player, default 'floor' + self.ground = elmt_val('symbol', 'name', 'floor', 0) self.stock = [] self.stock_num = 0 @@ -77,15 +77,15 @@ class Player: if next_position in self.maze.RANGE: next_symbol = self.maze.string[next_position] - # is a 'void' element - if next_symbol == elmt_val('symbol', 'name', 'void', 0): + # is a 'floor' element + if next_symbol == elmt_val('symbol', 'name', 'floor', 0): self.position = next_position self.status_message['status'] = MSG_OK # is a 'item' element elif next_symbol in elmt_val('symbol', 'item', True): self.position = next_position - self.ground = elmt_val('symbol', 'name', 'void', 0) + self.ground = elmt_val('symbol', 'name', 'floor', 0) self.stock.append( elmt_val('name', 'symbol', next_symbol, 0) )