import java.applet.*;
import java.awt.*;
import java.awt.image.*;


class Playfield extends Raster {
  Raster background;          // background image
  AnimatedSprite sprite[];    // list of sprites on this playfield

  public Playfield(Image bgnd, int numSprites)
    {
      super(bgnd);
      background = new Raster(bgnd);
      sprite = new AnimatedSprite[numSprites];
    }

  public void addSprite(int i, AnimatedSprite s)
    {
      sprite[i] = s;
    }

  
  public void Draw( )
    {
      changeImage(background.toImage());  // paint the background
      
      for (int i = 0; i < sprite.length; i++) {
	sprite[i].Draw(this);
	sprite[i].nextState();
      }
    }

};
