public class CarShape extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
width |
private int |
x |
private int |
y |
Constructor and Description |
---|
CarShape(int x,
int y,
int width)
Constructs a car shape.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.awt.geom.Point2D p) |
void |
draw(java.awt.Graphics2D g2) |
void |
translate(int dx,
int dy) |
public CarShape(int x, int y, int width)
x
- the left of the bounding rectangley
- the top of the bounding rectanglewidth
- the width of the bounding rectangle