Table of ContentsThe Development ProcessConclusion

Your Idea

As you progress through Part 3, your goal is to develop a professional-quality J2ME game. To do so, you first need to put all this sage game design advice into action and consider what features you'll have in your game.

You've already determined the minimum requirements and the reference device, so now you can choose the game type.

Game Type

Because you're here to work on the more advanced aspects of J2ME game development, the best type of game to develop should also be the hardestan action game. So what sort of action game will it be?

The most popular type of J2ME action game is the scrolling shooter. In this type of game, the player controls a ship (or other character) that remains reasonably static on screen while the terrain scrolls horizontally or vertically around it. The player is able to move around on the screen, dodging baddies (or blowing them away) as they scroll by. It's a classic formula game that players will instinctively understand.

To make things a little more interesting, though, you can make this a four-way scrolling space shooter. As you can see in Figure 8.3, this means the player will be able to fly in both horizontal and vertical directions at the same time. Think of it as something like Asteroids, but with a scrolling world below the player.

Figure 8.3. In a four-way scrolling space shooter, the player's ship is located in the center of the screen.

graphic/08fig03.gif


Game Name

Before you go any further, you should give your new project a name. Because it involves space, ships, and blowing things apart, call it Star Assault. I know that's not the best name, but it's all I could come up with at the time, okay? Send me an e-mail if you come up with something better …er, on second thought, don't.

Setting

Now you need a little background for the game. This is typically pretty easy for action or adventure games. (I'm not sure what the background plot to Tetris ismaybe you have to stop an invasion by an evil race of box shapes!)

Is a background story worth creating? It's really up to you. I add them because I feel they add strength to the game design. The plot doesn't have to be complicated, but setting the scene can really help motivate the team (especially the graphics guys), and it gives you a way to visualize the game more easily. Aside from that, backgrounds are usually fun to write.

To give you an idea what I mean, here's the background for Star Assault.(Get some tissues; it's a sad saga.)

The massive bulk of the Britanic, the United Space Command's flagship Star Car rier, slid across space, eclipsing the sun of an alien world like some long-lost titan of the heavens. In its belly lay the hope of mankindan offer of peace. A peace that many dared to believe would end this war to end all wars.

The death toll, now standing in the billions, came at a ten-fold cost to the Alien Horde. But the Terran onslaught that had begun with heroes had slowly turned to ruin. A victory of numbers hollowed only the more by the next being ever greater. Endless…infinite, it seemed. The Horde had kept coming.

Now the battle cry of the would-be conqueror had turned to a plea of mercy. The offer of peace, purported as already accepted by the Horde, need only be delivered to come into force. The Britanic, along with her crew of more than 200,000, was now deep within the alien home world's intricate web of defenses, on its way to complete a simple mission….

A Hurricane class assault fighter swept in from routine patrol, its sensors staring back at the pilot with an impossible emptiness where the Star Carrier should have been. The scattered debris was the only evidence of what had become of the Britanic.

Now, lost deep inside an alien defense grid, the way home betrayed, a lone fighter had only the memories of comrades to cling tomemories that were soon ablaze in flames of rage. Vowing to avenge them all, one fighter, accompanied only by the ghosts of lost comrades, would brandish the greatest weapon mankind had ever known …

Revenge.

Game Play

A player begins a new game of Star Assault at the controls of a shiny new Hurricane class assault fighter. The aim of the game is to fly the ship through a maze of defenses to try to locate the jump-gate that leads to the next level.

As the player progresses, he has to work through ever more complicated, randomly generated levels, doing battle against enemy mines, defense turrets, and fighters.

Given that control of the ship is more difficult than in the typical scrolling shooter, you should be more forgiving of mistakes by having the ship bounce off walls, rather than explode on impact. This bouncing effect will also apply to weapons (which will create some interesting combat techniques as a bonus).

Features

Star Assault has a whole host of features that form the basis of the game. The following sections detail these features.

Configuration

In case the player is using a phone with a non-standard layout, you should let them reconfigure the default numeric keys. Certain game functions, such as vibration and auto-fire, should also be configurable.

Four-Way Scrolling

This game uses a four-way scrolling model that provides more free-flowing game play than the more restricted single-dimension scrolling games. Because of this, you need to deal with extra issues such as a more restricted viewing area (caused by centering the view on the ship) and extra graphics to accommodate the 360-degree turning. It's nothing you can't handle, though.

Enemy AI

The evil of the Horde will come in the form of three types of enemy unitsmines (dumb floating bombs), turrets (fixed units that can sense the player's ship and then turn and fire), and fighters (smart ships that will target the player and chase after him, guns blazing).

Random Level Generator

To keep things interesting, Star Assault will generate a new level as the player enters. This will add to the game's replayability (how many times a player wants to come back and play again), as well as remove the need for you to store level data as a resource.

Level Graphics

Each level will be a connected series of rooms, so the primary level graphics are the tiles that form the walls of each room. For Star Assault, you should keep this simple and use a basic square tile for the walls.

To make things a little more interesting, you'll draw a background star field behind the level tiles. This will scroll at a different rate than the level to create a cool visual illusion that the stars are far off in the distance.

Save Game

Players won't be impressed if they have to restart the game every time they play, so you should implement a save game function that automatically persists the current level (keep in mind that it was randomly generated) and other game state information to non-volatile memory via the RMS, and then gives the player a resume option when he returns.

Interface

The game controls for Star Assault are pretty simple. The main control of the ship is by the left and right arrow keys. To keep things simpler for the player, the ship will auto-thrust forward (slowly).

Given that many modern MIDs have arrow pads, and you have the up direction free, you might as well make the up arrow the fire button. On most phones, this means players will be able to play with only their thumbs on the arrow pad.

Resources

Table 8.1 contains a list of all the resources I initially estimate this project will require. As you can see, it's a surprising amount for a relatively simple game project.

Table 8.1. Resource List

Graphic Name

Estimated Size

Purpose

Player Ship

2 KB

The player's ship facing 16 directions

Enemy Mine

2 KB

Animated spinning mine

Enemy Turret

2 KB

Enemy turret facing 16 directions

Enemy Fighter

2 KB

Enemy ship facing 16 directions

Level Tiles

1 KB

Tiles for the world

Star Field

1 KB

Star graphics for the backgrounds

Splash

5 KB

A title graphic for the splash

Weapons Fire

1 KB

Graphics for weapons fire (flying and exploding)

Explosion

2 KB

Big animated explosion representing the end of an enemy (or us)

Shields

1 KB

Animated shield for showing impact effects


The total estimate for graphics is 19 KB, which should leave you plenty of room for your class files.

    Table of ContentsThe Development ProcessConclusion