Class MovingItem
java.lang.Object
Item
MovingItem
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ExplorerBot, Organism, Organism.BodySegment, Player, PushableItem, Snake, Snake.BodySegment, Square, Square.BodySegment
public class MovingItem
- extends Item
- See Also:
- Serialized Form
Methods inherited from class Item |
action, age, className, color, displacement, displacement, distanceFrom, distanceFrom, environment, image, incrementAge, isActive, isAlive, isEdible, isPortable, isPushable, isSolid, message, messageCounter, performSpecificFunction, position, radiusOfContact, reduceMessageCounter, remove, setActive, setAge, setColor, setEnvironment, setImage, setMessage, setPosition, setRadiusOfContact, showMessage, theCloser, toImage, touchingDistance |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
direction
private Vector direction
speed
private double speed
turningSpeed
private double turningSpeed
initialTurningSpeed
private double initialTurningSpeed
MovingItem
public MovingItem(Vector pos,
Environment env)
move
public boolean move()
move
public boolean move(double dist,
Vector dir)
collideAction
public void collideAction(Item other,
Vector oldPos)
turnRight
public void turnRight()
turnLeft
public void turnLeft()
turn
public void turn(double angle)
direction
public Vector direction()
setDirection
public void setDirection(Vector dir)
speed
public double speed()
setSpeed
public void setSpeed(double s)
turningSpeed
public double turningSpeed()
setTurningSpeed
public void setTurningSpeed(double s)
setInitialTurningSpeed
public void setInitialTurningSpeed(double a)
initialTurningSpeed
public double initialTurningSpeed()
moveBackward
public boolean moveBackward()
strafeRight
public boolean strafeRight()
strafeLeft
public boolean strafeLeft()
checkIfTouching
public Item checkIfTouching(java.util.Set items)
checkIfTouching
public Item checkIfTouching(java.util.Set items,
Vector pos)
classImage
public void classImage(java.awt.Graphics g,
Vector pos,
double zoom)
- Overrides:
classImage
in class Item