From 00dcbed592b743e5fa31a0a3870ac590365436b0 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 23 Nov 2015 11:43:07 +0100 Subject: Implement Blinky A.I. --- src/ch/epfl/maze/physical/pacman/Blinky.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ch/epfl/maze/physical/pacman/Blinky.java b/src/ch/epfl/maze/physical/pacman/Blinky.java index f91f5e0..b3ac64e 100644 --- a/src/ch/epfl/maze/physical/pacman/Blinky.java +++ b/src/ch/epfl/maze/physical/pacman/Blinky.java @@ -3,13 +3,13 @@ package ch.epfl.maze.physical.pacman; import ch.epfl.maze.physical.Animal; import ch.epfl.maze.physical.Daedalus; import ch.epfl.maze.physical.GhostPredator; -import ch.epfl.maze.util.Direction; import ch.epfl.maze.util.Vector2D; /** * Red ghost from the Pac-Man game, chases directly its target. + * + * @author Pacien TRAN-GIRARD */ - public class Blinky extends GhostPredator { /** @@ -17,20 +17,24 @@ public class Blinky extends GhostPredator { * * @param position Starting position of Blinky in the labyrinth */ - public Blinky(Vector2D position) { super(position); - // TODO } + /** + * Targets directly the current position of the Prey. + * + * @param daedalus The Daedalus + * @return The position of the Prey + */ @Override - public Direction move(Direction[] choices, Daedalus daedalus) { - // TODO - return Direction.NONE; + protected Vector2D getPreyTargetPosition(Daedalus daedalus) { + return this.getPreyPosition(daedalus); } @Override public Animal copy() { return new Blinky(this.getPosition()); } + } -- cgit v1.2.3