Class Truck

java.lang.Object
  extended by Vehicle
      extended by Car
          extended by Truck

public class Truck
extends Car

A Truck to drive down the road.


Field Summary
 
Fields inherited from class Car
color
 
Fields inherited from class Vehicle
facingRight, position, speed
 
Constructor Summary
Truck()
          Creates a new Truck object.
 
Method Summary
 void draw(Canvas canvas)
          Draws the Truck on the given Canvas
 void turn()
          Turns the Truck--but trucks are too big to turn, so this method does nothing.
 
Methods inherited from class Car
drive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Truck

public Truck()
Creates a new Truck object.

Method Detail

draw

public void draw(Canvas canvas)
Draws the Truck on the given Canvas

Overrides:
draw in class Car
Parameters:
canvas - The canvas on which to draw

turn

public void turn()
Turns the Truck--but trucks are too big to turn, so this method does nothing. Overriding parent's method to remove functionality.

Overrides:
turn in class Vehicle