import java.awt.Dimension;
import javax.swing.*;

/**
 * Clickomania Applet
 * <P>
 * @author Owen Astrachan
 */
public class ClickomaniaApplet extends JApplet
{
    private Dimension getDimension()
    {
	int rows = 6;
	int cols = 15;
	try{
	    rows = Integer.parseInt(getParameter("rows"));
	    cols = Integer.parseInt(getParameter("cols"));
	}
	catch (Exception e){
	    // in case format bad or params missing
	}
	return new Dimension(rows,cols);
    }
    /**
     */
    public void init()
    {
	Dimension d = getDimension();
	GameModel model = new ClickomaniaModel(d.height,d.width);	
	JPanel panel = new GameCore(model,new ClickomaniaPanel(model));
	setContentPane(panel);
	setVisible(true);
    }
}
