import java.awt.Color;
import java.awt.Component;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;

import java.awt.image.ImageObserver;
import java.awt.image.MemoryImageSource;
import java.awt.image.PixelGrabber;

class   PlayFrame
extends Frame
{
	public  Playfield playfield;
	private Image     frame_image;

    /**
     *  This constructor creates an Raster initialized
     *  with the contents of an image.
     */
    public PlayFrame( Image img )
    {
		super();
		playfield = new Playfield( img );
    }


    /**
     *  Draw the sprite on the input raster.
     */
    public void
	paint( Graphics g )
    {
		System.out.println( "Painting the image " );
		g.drawImage( frame_image, 0, 0, this );
		System.out.println( "Painted the image" );
    }


    /**
     *  Draw the sprite on the input raster.
     */
    public void
	draw( Graphics g )
    {
		System.out.println( "Preparing the playfield" );
		playfield.draw();
		System.out.println( "Getting the image from the playfield" );
		frame_image = playfield.toImage( this );
		repaint();
    }
}
