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
-
Car(TrackPosition, Color, Color, GasPedal)
- Create a new car
-
canMove()
-
-
erase(Graphics)
- Erase this Car
-
height()
-
-
move(long)
- Move the car ahead in time
-
paint(Graphics)
- Paint this car
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
paint
public void paint(Graphics g)
- Paint this car
- Parameters:
- g - Destination for drawing
- Overrides:
- paint in class Drawable
erase
public void erase(Graphics g)
- Erase this Car
- Parameters:
- g - The graphics on which erasing is to occur
- Overrides:
- erase in class Drawable
canMove
public boolean canMove()
- Returns:
- true iff this drawable might move around the screen
- Overrides:
- canMove in class Drawable
height
public int height()
- Returns:
- the height of this drawable. Higher drawables will be drawn
first.
- Overrides:
- height in class Drawable
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