uwcse.sim
Class Monster
java.lang.Object
|
+--uwcse.sim.PacThing
|
+--uwcse.sim.MovingThing
|
+--uwcse.sim.Monster
- All Implemented Interfaces:
- Thing
- class Monster
- extends MovingThing
The monster moves around, hunting the Man object.
Constructor Summary |
Monster(WorldModel wm,
int x,
int y,
Man pacMan)
For efficiency's sake, the Monster knows about the man in the
simulation. |
Method Summary |
void |
action()
Moves about half the time. |
void |
displayOn(uwcse.graphics.GWindow g)
Displays as a red oval. |
void |
interact(PacThing t)
Kills the Man. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
pacMan
Man pacMan
Monster
public Monster(WorldModel wm,
int x,
int y,
Man pacMan)
- For efficiency's sake, the Monster knows about the man in the
simulation.
displayOn
public void displayOn(uwcse.graphics.GWindow g)
- Displays as a red oval.
- Overrides:
displayOn
in class MovingThing
action
public void action()
- Moves about half the time. When it moves, its goal is to
minimize the x and y distance between it and the pacman.
- Overrides:
action
in class MovingThing
interact
public void interact(PacThing t)
- Kills the Man.
- Overrides:
interact
in class MovingThing