// Cliff Class // Cliff.java // Imports import java.awt.*; import java.applet.Applet; import java.util.BitSet; public class Cliff extends Sprite { public static Image[] image; /**Constructor*/ public Cliff(Component comp, int i, Point pos) { super(comp, // Component image, // Image to use i, // Current Frame 0, // Frame Increment 0, // Frame Delay pos, // Current Location new Point(0, 0), // Velocity 5, // Z-Order Sprite.BA_STOP); // Bounds Action // Direction } public static void initResources(Applet app, MediaTracker tracker, int id) { image = new Image[2]; for (int i = 0; i < 2; i++) { image[i] = app.getImage(app.getCodeBase(), "Res/Cliff" + i + ".gif"); tracker.addImage(image[i], id); } } protected void setCollision() { collision = new Rectangle(position.x + 7, position.y + 7, position.width - 7, position.height - 7); } public BitSet update() { return (new BitSet()); } }