|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.ObjectVehicle
public class Vehicle
A Vehicle that can drive and turn down the road.
| Field Summary | |
|---|---|
protected boolean |
facingRight
|
protected int |
position
|
protected int |
speed
|
| Constructor Summary | |
|---|---|
Vehicle()
Creates a new Vehicle object. |
|
| Method Summary | |
|---|---|
void |
draw(Canvas canvas)
Draws the vehicle on the given canvas. |
void |
drive()
Drives the vehicle its speed, turning around if necessary. |
void |
turn()
Turns the vehicle around. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean facingRight
protected int position
protected int speed
| Constructor Detail |
|---|
public Vehicle()
| Method Detail |
|---|
public void draw(Canvas canvas)
canvas - The canvas on which to drawpublic void drive()
public void turn()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||