| C:\eclipse\workspace\Epsilon_01\src\Game.java |
1 /**
2 * Game contains the MIDlet for the Epsilon game.
3 * Epsilon is a simple space-shooter-vertical-scroller game.
4 *
5 * Epsilon is available for non-commercial use only!
6 * You can learn from this sources and you can modify them
7 * for learning purposes.
8 *
9 * @author Ziga Hajdukovic
10 * @version 1.0
11 */
12
13 import javax.microedition.midlet.*;
14 import javax.microedition.lcdui.*;
15
16 public class Game extends MIDlet
17 {
18 public Game()
19 {
20 }
21
22 public void startApp()
23 {
24 GameCanvas gameCanvas = new GameCanvas(this);
25 Display.getDisplay(this).setCurrent(gameCanvas);
26 try {
27 // Start the game in its own thread
28 Thread myThread = new Thread(gameCanvas);
29 myThread.start();
30 } catch (Error e) {
31 destroyApp(false);
32 notifyDestroyed();
33 }
34 }
35
36 public void pauseApp()
37 {
38 }
39
40 public void destroyApp(boolean b)
41 {
42 }
43
44 void exitRequested()
45 {
46 destroyApp(false);
47 notifyDestroyed();
48 }
49 }
50