// "Exer2a.java" - Exercise on Classes
//
// Modify this program to simultaneously slides three happy faces from the
// left side of the screen to the right side.
// Assume the radius of the happy face is 50.  Use applet's getSize ()
// to determine the applet's height and width.

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

public class MovingHappyFaceClassDemo extends Applet
{
    public void paint (Graphics g)
    {
	MovingHappyFaceClass [] face;
	int width = getSize ().width;
	int height = getSize ().height;

	face = new MovingHappyFaceClass [6];
	for (int i = 0 ; i < 6 ; i++)
	{
	    face [i] = new MovingHappyFaceClass (width, height);
	    face [i].show (g);
	}

	for (int i = 0 ; i < 1000 ; i++)
	{
	    for (int faces = 0 ; faces < 6 ; faces++)
	    {
		face [faces].slide (g, getBackground ());
	    }
	}
    } // paint method
} // Exer2a class
