/**
 * PongMIDlet contains the basic MIDlet class for a simple Pong game
 *
 * Simple Pong is available for non-commercial use only!
 * 
 * @author      Ziga Hajdukovic
 * @version     1.0
 */

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class PongMIDlet extends MIDlet
{
	public PongMIDlet()
	{
	}

	public void startApp()
	{
		PongCanvas pongCanvas = new PongCanvas(this);
		Display.getDisplay(this).setCurrent(pongCanvas);
	    try {
	        // Start the game in its own thread
	        Thread myThread = new Thread(pongCanvas);
	        myThread.start();
	    } catch (Error e) {
	        destroyApp(false);
	        notifyDestroyed();
	    } 
	}

	public void pauseApp()
	{
	}

	public void destroyApp(boolean b)
	{
	}

	void exitRequested()
	{
		destroyApp(false);
		notifyDestroyed();
	}
}
