aboutsummaryrefslogtreecommitdiff
path: root/src/Ghost.py
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-04-16 17:49:50 +0200
committeromagdy7 <omar.professional8777@gmail.com>2023-04-16 17:49:50 +0200
commit3634fcc4f9f62d40ea03ba890a3290e05ed20ed8 (patch)
tree5983f58f8512ca7386932a1549302d3e9fd7f3ba /src/Ghost.py
parentfd985ac6bc684cdbe89e2c93ea098419977a01f5 (diff)
downloadMacpan-3634fcc4f9f62d40ea03ba890a3290e05ed20ed8.tar.xz
Macpan-3634fcc4f9f62d40ea03ba890a3290e05ed20ed8.zip
Added all ghosts with A* search for now
Diffstat (limited to 'src/Ghost.py')
-rw-r--r--src/Ghost.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/Ghost.py b/src/Ghost.py
index 11c195b..d4bc683 100644
--- a/src/Ghost.py
+++ b/src/Ghost.py
@@ -1,9 +1,7 @@
-from typing import List
import pygame
import math
from Direction import DIRECTION
import map as Map
-import random
class Ghost():
def __init__(self, color, x, y):
@@ -69,15 +67,7 @@ class Ghost():
if self.check_collision(nx, ny, 30, 30, maze):
ret[i] = self.heuristic((nx, ny), pacman_pos)
- print("--------------------")
-
min_idx = ret.index(min(ret))
- print(f"last_move: {self.last_move}, current_move: {min_idx}")
- x1 = self.x + dx[2] * self.speed
- y1 = self.y + dy[2] * self.speed
- x2 = self.x + dx[0] * self.speed
- y2 = self.y + dy[0] * self.speed
- print(f"hl = {self.heuristic((x1, y1), pacman_pos)}, h2 = {self.heuristic((x2, y2), pacman_pos)}")
return min_idx