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

         class Playfield extends Raster 
   {
             Raster background;          // background image
             Image output;
             Sprite s[];      	
             int x, y;
             int num;  // the number of sprites on the playfield
   

	   public Playfield(Image bgnd)  // initialize the playfield with the background image
	   { 
	  
	     background = new Raster(bgnd); 
	     width=background.width;
	     height=background.height;
	     x=0;
	     y=0;
             num=0;
	   }

          

	   public void addSprite(Image img)             
	   { 
	     s[num] = new Sprite(img); 
             num++;
	   }
	   

	   public void Draw( )
	   {
              for(int i=0; i<=num; i++)
	      {
	       s[i].Draw(background);
               output = s[i].r_output.toImage();               
              }
           }

   }
         


