Professional Documents
Culture Documents
Interface
Interface
Interface
import dungeongenerator
import pygame
#actions!
def end_turn(dungeon, character):
if dungeon.initiative_list[0] != dungeon.initiative_list[-1]:
dungeon.initiative_list.append(dungeon.initiative_list.pop(0)) # Move the
current character to the end of the list
else:
dungeon.initiative_list.insert(0, dungeon.initiative_list.pop()) # Move
the last character to the beginning of the list
# Calculate the Manhattan distance between the current tile and the clicked tile
distance = room.manhattan_distance((current_tile.i, current_tile.j),
(clicked_tile.i, clicked_tile.j))
# If the clicked tile is within the character's movement range, move the
character to the clicked tile
if distance <= character.movement_rate:
current_tile.character = None
clicked_tile.character = character
character.current_move = character.current_move + 1
else:
print('Cannot move to that location.')