//Car.java
//A car class that draws a ar on the screen


import java.awt.*;
public class Car
{

	//Instance fields
	private int x;

	private int y;


	// Constructors
	public Car (int xx, int yy)

	{
		x = xx;
		y = yy;

	}


	// Methods

public void draw(Graphics gr)
{
	//body

	gr.setColor(new Color(255,128,0));
	gr.fillRect(x+0, y+25, 100,35);
	//top
	int[] xTop = {x+50,x+80, x+100, x+50, x+50};
	int[] yTop = {y+0, y+0, y+25, y+25, y+0};
	gr.fillPolygon(xTop, yTop, xTop.length);


	//windshield
	gr.setColor(Color.white);

	int[] xWind = {x+50,x+50, x+25, x+50};
	int[] yWind = {y+0, y+25, y+25, y+0};
	gr.fillPolygon(xWind, yWind, xWind.length);
	//FrontTire
	gr.setColor(Color.black);
	gr.fillOval(x+0, y+50, 40, 40);
	//RearTire
	gr.fillOval(x+60, y+50, 40, 40);


}



}

