Table of ContentsChapter 13.            The Front EndThe Application Class

Front End Overview

Every quality J2ME game needs a front end of some type, even if it's just a basic menu with New Game and Exit options. However, most games require quite a bit more. In Figure 13.1, you can see the front end you'll develop for Star Assault.

Figure 13.1. The flow of the application screens in Star Assault

graphic/13fig01.gif


The front end begins when the MIDlet starts, at which point you display a splash screen. This serves to introduce the game, make a copyright and ownership statement, and get the player a little excited. Figure 13.2 shows the splash screen you'll create for Star Assault.

Figure 13.2. A splash screen for Star Assault

graphic/13fig02.gif


After the splash screen you present the main menu (see Figure 13.3) containing the various options to configure the game or get started playing. Like any good game, Star Assault has a variety of configuration options including enabling or disabling auto-fire, vibration, and the star field background (to increase rendering speed). The player can also reconfigure which keys correspond to different game actions (in case he is using an MID with a different keyboard layout than what you expect).

Figure 13.3. The main menu provides options to manage the game and configuration options.

graphic/13fig03.gif


In the same way that GameScreen glues together all the game components, the MIDlet (or application class) drives the front end. You start developing the front end for Star Assault there.

    Table of ContentsChapter 13.            The Front EndThe Application Class