sim.app.pacman.Blinky Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mason Show documentation
Show all versions of mason Show documentation
MASON is a fast discrete-event multiagent simulation library core in Java, designed to be the foundation for large custom-purpose Java simulations, and also to provide more than enough functionality for many lightweight simulation needs. MASON contains both a model library and an optional suite of visualization tools in 2D and 3D.
The newest version!
/*
Copyright 2009 by Sean Luke and Vittorio Zipparo
Licensed under the Academic Free License version 3.0
See the file "LICENSE" for more information
*/
package sim.app.pacman;
import sim.engine.*;
import sim.field.continuous.*;
import sim.util.*;
import ec.util.*;
/** Blinky is the red ghost. He starts outside of the box (and is not initially waiting).
His target (see Ghost.java) is the Pac himself. */
public class Blinky extends Ghost
{
private static final long serialVersionUID = 1;
public Double2D getStartLocation() { return new Double2D(13.5, 13); }
public Blinky(PacMan pacman)
{
super(pacman);
waiting = 0; // not waiting.
}
public Double2D getTarget()
{
return new Double2D(pacman.pacClosestTo(location).location);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy