Class Car
java.lang.Object
|
+--Car
- All Implemented Interfaces:
- Timed
- public class Car
- extends java.lang.Object
- implements Timed
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
timePerTick
public static final double timePerTick
metersPerPixel
public static final double metersPerPixel
carRoutes
public static final int carRoutes
carsEntered
public static int carsEntered
carsExited
public static int carsExited
carGenerator
protected CarGenerator carGenerator
ticker
protected TimeManager ticker
carPath
protected CarContainer[] carPath
AREA
protected java.awt.Dimension AREA
width
protected int width
length
protected int length
halfwidth
protected int halfwidth
halflength
protected int halflength
carShape
public java.awt.Shape carShape
distanceToEnd
protected double distanceToEnd
speed
protected double speed
topspeed
protected int topspeed
inFrontInfo
protected double[] inFrontInfo
iD
protected int iD
Car
public Car(LaneSection startLane,
CarGenerator parent,
TimeManager theTick,
int topspeed)
checkSetUp
public boolean checkSetUp()
centerX
public float centerX()
centerY
public float centerY()
removefromTimer
public void removefromTimer()
drawCar
public void drawCar(java.awt.Graphics2D g2d)
getDistanceToNext
public java.lang.String getDistanceToNext()
getSpeedOfNext
public java.lang.String getSpeedOfNext()
drawGhostCar
public void drawGhostCar(java.awt.Graphics2D g2d)
pretick
public void pretick()
- Specified by:
pretick
in interface Timed
tick
public void tick()
- Specified by:
tick
in interface Timed
collide
public boolean collide(Car target)
getSpeedString
public java.lang.String getSpeedString()
setNewPosition
public void setNewPosition(double speed,
double angle)
getFuturePath
public java.awt.Shape getFuturePath()
- Shows the path that the car has planned to take