Skip to content
Snippets Groups Projects
Commit d41bde7f authored by DannyAbdi's avatar DannyAbdi
Browse files

fixed a bug that caused an attribute error when trying to draw the maze

parent 7e1a6d58
Branches
Tags
1 merge request!1Single and Multi-Agent Pathfinding in Maze games
...@@ -34,14 +34,14 @@ run = True ...@@ -34,14 +34,14 @@ run = True
while run: while run:
timer.tick(FPS) timer.tick(FPS)
maze.draw() maze.draw()
player.draw() player.draw(screen)
enemy1.draw(screen) enemy1.draw(screen)
easy_button.draw() easy_button.draw()
normal_button.draw() normal_button.draw()
hard_button.draw() hard_button.draw()
# player_controller.move_to_goal_dfs() # player_controller.move_to_goal_dfs()
# player_controller.move_to_goal_bfs() player_controller.move_to_goal_bfs()
# player_controller.move_to_goal_dijkstra() # player_controller.move_to_goal_dijkstra()
# player_controller.move_to_goal_astar() # player_controller.move_to_goal_astar()
......
...@@ -18,5 +18,5 @@ class Player: ...@@ -18,5 +18,5 @@ class Player:
This method utilizes the Pygame library to draw a white rectangle representing the player This method utilizes the Pygame library to draw a white rectangle representing the player
at the specified (x, y) coordinates with the size of TILE_SIZE. at the specified (x, y) coordinates with the size of TILE_SIZE.
""" """
def draw(self): def draw(self, screen):
pygame.draw.rect(screen, 'white', (self.x, self.y, TILE_SIZE, TILE_SIZE)) pygame.draw.rect(screen, 'white', (self.x, self.y, TILE_SIZE, TILE_SIZE))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment