A Sprite is a Raster
class Sprite extends Raster {
int x, y; // current position of sprite on playfield
int width, height; // size of a sprite's frame
public Sprite(Image image); // initialize sprite with an image
public void Draw(Raster bgnd); // draws sprite on a Raster
}
The Draw( ) method must handle transparent pixels, and it must
also handle all cases where the sprite overhangs the playfield.
|