import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import javax.swing.Timer;

public class TestSection10 extends Applet implements ActionListener{

	int counter = 0;
	int[] cargoX = {10, 30, 50, 70, 90, 110, 130, 150, 170, 190, 210};
	int[] cargoY = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10};
	int[] asteroidX = {10, 40, 70, 100};
	int[] asteroidY = {120, 90, 60, 30};
	boolean[] cargoDrawn = {true, true, true, true, true, true, true, true, true, true, true};
	Timer timer;
	
	public void init(){
		setSize(400,400);
		timer = new Timer(500, this);
		timer.start();
	}
	
	public void paint(Graphics p){
		
		p.setColor(Color.BLACK);
		p.fillRect(0, 0, 400, 400);
		
		
		
		
		//####################################
		// CALLING AND TESTING YOUR CODE
		drawAsteroids(asteroidX, asteroidY, p);
		
		//####################################
		// CALLING AND TESTING YOUR CODE
		drawCargo(cargoX, cargoY, cargoDrawn, p);
		
		
		
		
		
		cargoDrawn[counter] = !cargoDrawn[counter];
		counter = (counter+1)%cargoDrawn.length;
	}
	
	
	//----------------------------------------------------------------------------------------------------
	// #####   DRAWING METHODS   #######
	//----------------------------------------------------------------------------------------------------
	
	// method that draws the cargo pieces 
	public void drawCargo(int[] x, int[] y, boolean[] drawn, Graphics p){
		//####################################
		// FILL IN YOUR CODE HERE
		//####################################
	}
	
	
	//------------------------------------------------------------------
	// method that draws the asteroids 
	public void drawAsteroids(int[] x, int[] y, Graphics p){
		//####################################
		// FILL IN YOUR CODE HERE
		//####################################
	}
	
	
	//----------------------------------------------------------------------------------------------------
	// #####   RESPONSE TO USER INPUT METHODS   #######
	//----------------------------------------------------------------------------------------------------
	
	// timer went off, so repaint the window
	public void actionPerformed(ActionEvent event){
		repaint();
	}
}
