diff options
author | Pacien TRAN-GIRARD | 2015-11-23 11:43:07 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-11-23 11:43:07 +0100 |
commit | 00dcbed592b743e5fa31a0a3870ac590365436b0 (patch) | |
tree | b8418afb306ba56fc774714d96a67123716ab4bf /src/ch/epfl/maze/physical/pacman/Blinky.java | |
parent | 1cefc1b68f3eac7f5806828b5833ef6bd4f0d27d (diff) | |
download | maze-solver-00dcbed592b743e5fa31a0a3870ac590365436b0.tar.gz |
Implement Blinky A.I.
Diffstat (limited to 'src/ch/epfl/maze/physical/pacman/Blinky.java')
-rw-r--r-- | src/ch/epfl/maze/physical/pacman/Blinky.java | 18 |
1 files changed, 11 insertions, 7 deletions
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; | |||
3 | import ch.epfl.maze.physical.Animal; | 3 | import ch.epfl.maze.physical.Animal; |
4 | import ch.epfl.maze.physical.Daedalus; | 4 | import ch.epfl.maze.physical.Daedalus; |
5 | import ch.epfl.maze.physical.GhostPredator; | 5 | import ch.epfl.maze.physical.GhostPredator; |
6 | import ch.epfl.maze.util.Direction; | ||
7 | import ch.epfl.maze.util.Vector2D; | 6 | import ch.epfl.maze.util.Vector2D; |
8 | 7 | ||
9 | /** | 8 | /** |
10 | * Red ghost from the Pac-Man game, chases directly its target. | 9 | * Red ghost from the Pac-Man game, chases directly its target. |
10 | * | ||
11 | * @author Pacien TRAN-GIRARD | ||
11 | */ | 12 | */ |
12 | |||
13 | public class Blinky extends GhostPredator { | 13 | public class Blinky extends GhostPredator { |
14 | 14 | ||
15 | /** | 15 | /** |
@@ -17,20 +17,24 @@ public class Blinky extends GhostPredator { | |||
17 | * | 17 | * |
18 | * @param position Starting position of Blinky in the labyrinth | 18 | * @param position Starting position of Blinky in the labyrinth |
19 | */ | 19 | */ |
20 | |||
21 | public Blinky(Vector2D position) { | 20 | public Blinky(Vector2D position) { |
22 | super(position); | 21 | super(position); |
23 | // TODO | ||
24 | } | 22 | } |
25 | 23 | ||
24 | /** | ||
25 | * Targets directly the current position of the Prey. | ||
26 | * | ||
27 | * @param daedalus The Daedalus | ||
28 | * @return The position of the Prey | ||
29 | */ | ||
26 | @Override | 30 | @Override |
27 | public Direction move(Direction[] choices, Daedalus daedalus) { | 31 | protected Vector2D getPreyTargetPosition(Daedalus daedalus) { |
28 | // TODO | 32 | return this.getPreyPosition(daedalus); |
29 | return Direction.NONE; | ||
30 | } | 33 | } |
31 | 34 | ||
32 | @Override | 35 | @Override |
33 | public Animal copy() { | 36 | public Animal copy() { |
34 | return new Blinky(this.getPosition()); | 37 | return new Blinky(this.getPosition()); |
35 | } | 38 | } |
39 | |||
36 | } | 40 | } |