// FlyingSaucer Class
// FlyingSaucer.java

// Imports
import java.awt.*;
import java.applet.Applet;
import java.util.*;

public class HyperFlyingSaucer extends FlyingSaucer implements Runnable {

	protected static Random rand = new Random(System.currentTimeMillis());


  	public boolean keyDown(Event evt, int key) 
  	{
	// Change the saucer velocity based on the key pressed
		Point vel = theSaucer.getVelocity();
		switch (key) 
		{
			case Event.UP:
				Point p = new Point(Math.abs(rand.nextInt() % size().width), Math.abs(rand.nextInt() % size().height));
				theSaucer.setPosition(p);
				break;
    	}
		return super.keyDown(evt, key);
	}
}
