From 7194ca65ae23d96960fe7edb619efb100db0a49c Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Thu, 20 Apr 2023 19:58:39 +0200 Subject: Added the abillity to portals and also made the ghots favour going up when there is a conflict --- src/pinky.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/pinky.py') diff --git a/src/pinky.py b/src/pinky.py index 8b2bee1..42b5d91 100644 --- a/src/pinky.py +++ b/src/pinky.py @@ -1,6 +1,6 @@ +import pygame from typing_extensions import override from direction import DIRECTION -from settings import settings import math from ghost import Ghost @@ -36,7 +36,7 @@ class Pinky(Ghost): return (pacman.x, pacman.y) @override - def get_next_move(self, target, maze): + def get_next_move(self, target, maze, screen): dx = [1, 0, -1, 0] dy = [0, 1, 0, -1] @@ -54,6 +54,7 @@ class Pinky(Ghost): forbidden = 1 new_target = self.get_four_tiles_ahead_of_pacman(target) + pygame.draw.circle(screen, self.color, (new_target[0], new_target[1]), 15) for i in range(len(dx)): if i != forbidden: -- cgit v1.2.3