import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

import javax.swing.Timer;

public class TestSection2 extends Applet implements ActionListener, KeyListener{
	int shipSpeedY=0;
	int shipSpeedX=0;
	int x=50;
	int y=50;
	Timer timer;
	
	public void init(){
		timer = new Timer(50, this);
		timer.start();
		addKeyListener(this);
	}
	
	public void paint(Graphics p){
		x = x + shipSpeedX;
		y = y + shipSpeedY;
		
		p.setColor(Color.BLACK);
		p.fillRect(0, 0, 400, 400);
		p.setColor(Color.RED);
		p.fillOval(x, y, 20, 20);
		p.drawString("x:"+shipSpeedX+" y:"+shipSpeedY, 20, 20);
	}
	
	//----------------------------------------------------------------------------------------------------
	// #####   RESPONSE TO USER INPUT METHODS   #######
	//----------------------------------------------------------------------------------------------------
	
	// timer went off, so repaint the window
	public void actionPerformed(ActionEvent event){
		//####################################
		// FILL IN YOUR CODE HERE
		//####################################
	}
	
	
	//------------------------------------------------------------------
	// move the ship if the user pressed up, down, left, or right
	public void keyPressed(KeyEvent event){
		//####################################
		// FILL IN YOUR CODE HERE
		//####################################
	}
	public void keyTyped(KeyEvent event) {}
	public void keyReleased(KeyEvent event) {}
}
