this is the super class, Sprite:
public class Sprite
{
// default step sizes (how far to move in each update)
private static int XSTEP = 5;
private static int YSTEP = 5;
// default dimensions when there is no image
private static final int SIZE = 12;
// image-related
private ImagesLoader imsLoader;
private String imageName;
private BufferedImage image;
private int width, height; // image dimensions
private ImagesPlayer player; // for playing a loop of images
private boolean isLooping;
private int pWidth, pHeight; // panel dimensions
private boolean isActive = true;
// a sprite is updated and drawn only when it is active
// protected vars
protected int locx, locy; // location of sprite
protected int dx, dy; // amount to move for each update
public Sprite(int x, int y, int w, int h, ImagesLoader imsLd, String name)
{
Boomerang extends Sprite.
Here is another class that extends sprite but does not have this issue:
public class JumperSprite extends Sprite
{
private static double DURATION = 0.5; // secs
// total time to cycle through all the images
private static final int NOT_JUMPING = 0;
private static final int RISING = 1;
private static final int FALLING = 2;
// used by vertMoveMode
// (in J2SE 1.5 we could use a enumeration for these)
private static final int MAX_UP_STEPS = 8;
// max number of steps to take when rising upwards in a jump
private int period; // in ms; the game's animation period
private boolean isFacingRight, isStill;
private int vertMoveMode;
/* can be NOT_JUMPING, RISING, or FALLING */
private int vertStep; // distance to move vertically in one step
private int upCount;
private BricksManager brickMan;
private int moveSize; // obtained from BricksManager
private int xWorld, yWorld;
/* the current position of the sprite in 'world' coordinates.
The x-values may be negative. The y-values will be between
0 and pHeight. */
public JumperSprite(int w, int h, int brickMvSz, BricksManager bm,
ImagesLoader imsLd, int p)
{
super(w/2, h/2, w, h, imsLd, "robStandRight");
does that help?