Skip to content

Commit

Permalink
collect keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Simone Pierazzini committed Nov 25, 2023
1 parent 2e014f0 commit 9b8ca0f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tng/game/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ def move_player(self, player_idx: int, pos: Position) -> 'Game':

dest_cell = self.board.at(pos)

if dest_cell.tile is Tile.key and not new_player_status.has_key:
new_player_status = new_player_status._replace(has_key=True)

if dest_cell.tile is Tile.pit:
new_player_status = new_player_status._replace(falling=True)
board_pos = None
Expand Down

0 comments on commit 9b8ca0f

Please sign in to comment.