Class Ant
- java.lang.Object
-
- com.iwolverton.smartbeetle.Coord
-
- com.iwolverton.smartbeetle.elements.GameElement
-
- com.iwolverton.smartbeetle.elements.ActingElement
-
- com.iwolverton.smartbeetle.elements.Ant
-
public class Ant extends ActingElement
Ants always move toward the beetle. They move one space per turn, just like the beetle. They can be stopped by shooting beads (ammo) at them, but only when they are directly adjacent to the beetle in one of the four cardinal directions.Ants spawn from the ant hill at intervals.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(DrawingParams dp)-
Methods inherited from class com.iwolverton.smartbeetle.elements.ActingElement
equals, getNextMove, toString
-
Methods inherited from class com.iwolverton.smartbeetle.Coord
altDirectionTo, diagonalDistanceFrom, diagonalDistanceFrom, directionTo, getX, getY, isAt, isAt, randCoord, randCoordPart, rightAngleDistanceFrom, rightAngleDistanceFrom
-
-
-
-
Field Detail
-
FREQUENCY
public static final int FREQUENCY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Ant
public Ant(int x, int y, int nextMove)
-
Ant
public Ant(int x, int y)
-
Ant
public Ant(Coord coord)
-
-
Method Detail
-
draw
public void draw(DrawingParams dp)
- Specified by:
drawin classGameElement
-
-