import java.applet.*; import java.awt.*; ///////////////////////////////////////////////////////////////// public class UFOManager { private UFO ufo[]; // array of ufos int ufosKilled; // count ufos killed int level; // the level // (i.e. #ufos on screen) int startLevel; int maxLevel; boolean playSound = true; // false; // initially no sound AudioClip expsound; // sound clip of explosion // kill 13 ufos until next level static final int KILL_FOR_NEXT_LEVEL = 13; static int width, height; // applet dimensions // constructor public UFOManager(int startLevel,int maxLevel,int width,int height, Image ufoImages[], Image attackImages[], Image explodeImages[], Applet a, AudioClip exp) { this.startLevel = startLevel; this.maxLevel = maxLevel; this.width = width; this.height = height; ufo = new UFO[maxLevel]; for (int i=0; i= level) { // suspend ufos // above start level ufo[i].suspend(); } } } // return array of ufos public UFO[] getUFO() { return ufo; } // paint all ufos in a level public void paint(Graphics g) { for (int i=0; i