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

public class TestSection3 extends Applet implements ActionListener{
	int shipSpeedY1=2;
	int shipSpeedX1=5;
	int x1=50;
	int y1=50;
	
	int shipSpeedY2=-2;
	int shipSpeedX2=-5;
	int x2=150;
	int y2=150;
	Timer timer;
	
	public void init(){
		setSize(400, 400);
		timer = new Timer(50, this);
		timer.start();
	}
	
	public void paint(Graphics p){
		
		
		
		
		x1 = updateXCoordinate(x1, shipSpeedX1);
		y1 = updateXCoordinate(y1, shipSpeedY1);
		
		x2 = updateXCoordinate(x2, shipSpeedX2);
		y2 = updateXCoordinate(y2, shipSpeedY2);
		
		
		
		
		
		p.setColor(Color.BLACK);
		p.fillRect(0, 0, 400, 400);
		
		p.setColor(Color.RED);
		p.fillOval(x1, y1, 20, 20);
		p.drawString("x:"+shipSpeedX1+"  y:"+shipSpeedY1, 20, 20);
		
		p.setColor(Color.GREEN);
		p.fillOval(x2, y2, 20, 20);
		p.drawString("x:"+shipSpeedX2+" y:"+shipSpeedY2, 20, 35);
	}
	
	
	//------------------------------------------------------------------
	// method that updates the x coordinate of a single asteroid
	public int updateXCoordinate(int x, int speed){
		//####################################
		// FILL IN YOUR CODE HERE
		//####################################
	}
	
	
	//------------------------------------------------------------------
	// method that updates the y coordinate of a single asteroid
	public int updateYCoordinate(int y, int speed){
		//####################################
		// FILL IN YOUR CODE HERE
		//####################################
	}
	
	
	//----------------------------------------------------------------------------------------------------
	// #####   RESPONSE TO USER INPUT METHODS   #######
	//----------------------------------------------------------------------------------------------------
	
	// timer went off, so repaint the window
	public void actionPerformed(ActionEvent event){
		repaint();
	}
}