Class jovial.slotCar.Car
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jovial.slotCar.Car

java.lang.Object
   |
   +----jovial.slotCar.animator.Drawable
           |
           +----jovial.slotCar.Car

public class Car
extends Drawable

Represents a slot car.

See also Car.gif for a description of the meaning of the variables.

See Also:
TrackPosition, RaceView

Constructor Index

 o Car(TrackPosition, Color, Color, GasPedal)
Create a new car

Method Index

 o canMove()
 o erase(Graphics)
Erase this Car
 o height()
 o move(long)
Move the car ahead in time
 o paint(Graphics)
Paint this car

Constructors

 o Car
  public Car(TrackPosition pos,
             Color drawColor,
             Color eraseColor,
             GasPedal gasPedal)
Create a new car
Parameters:
pos - Our initial positio
drawColor - This car's color
eraseColor - Color of what's under car, for erasing
gasPedal - The gas pedal we should use

Methods

 o paint
  public void paint(Graphics g)
Paint this car
Parameters:
g - Destination for drawing
Overrides:
paint in class Drawable
 o erase
  public void erase(Graphics g)
Erase this Car
Parameters:
g - The graphics on which erasing is to occur
Overrides:
erase in class Drawable
 o canMove
  public boolean canMove()
Returns:
true iff this drawable might move around the screen
Overrides:
canMove in class Drawable
 o height
  public int height()
Returns:
the height of this drawable. Higher drawables will be drawn first.
Overrides:
height in class Drawable
 o move
  public void move(long deltaT)
Move the car ahead in time
Parameters:
deltaT - Amount of time to move

All Packages  Class Hierarchy  This Package  Previous  Next  Index