// Spidercide Class // Spidercide.java // Imports import java.awt.*; import java.applet.Applet; import java.util.BitSet; public class Spidercide extends Sprite { protected static Image[] image = new Image[4]; /**Constructor*/ public Spidercide(Component comp, Point pos) { super(comp, image, 0, 1, 20, pos, new Point(0, 0), 10, Sprite.BA_DIE); } /** Initialize the images.*/ public static void initResources(Applet app, MediaTracker tracker, int id) { for (int i = 0; i < 4; i++) { image[i] = app.getImage(app.getCodeBase(), "Res/Spcide" + i + ".gif"); tracker.addImage(image[i], id); } } public BitSet update() { BitSet action = new BitSet(); // Die? if (frame >= 3) { action.set(Sprite.SA_KILL); return action; } // Increment the frame incFrame(); return action; } }