iPhone Game Development - Chris Craft [42]
@”%d”, currentLevelIndex] forKey:@”currentlevel”];
currentLevelIndex++;
[self loadLevel:currentLevelIndex];
}
Now you have been over all of the important details of how this application works. This is a simple puzzle app, but it illustrates how easy it can be to bring ideas to life on the iPhone. Most everything else you will find in the source is just the standard scaffolding necessary in all the applications you will build. Here is what the AmuckSlider looks like before any polishing (Figure 3.18).
FIGURE 3.18
AmuckSlider Game View before polishing
Tip
Try to prevent your code from nesting too deep. Change your logic so that you exit instead of nesting if-statements. You will thank yourself because the code will be much easier to maintain.
Polishing the Game View
So far you have been looking at the source from the unpolished version of this application. Now let's look at ways we can add excitement to the user's experience in the Game View just like we did for the Menu View. Like the Menu View, it does not take much to make the screen look a lot snazzier. Simply adding a few images and animations will do the trick. After a little image treatment you'll see how much more interesting the game board can be.
Here are the things we added to accomplish a better look:
A background image to the whole Game View
A semi-opaque background image to each tile
A much more interesting arrow image
A glass effect in front of the arrow
A green glow image that is visible when a tile is seated in its correct location
We also added a few animations to make the game more interesting:
The arrow spins to its correct location instead of snapping at the end of each turn.
The arrow fades out as the green glow fades in when the tile is in the correct location.
A puff effect shoots out from around a tile when it pops into the correct location.
When a level is completed, the puff effect replays for each arrow tile.
That is about it for polish. You will need to add an application icon before you are ready to publish an application to the App Store. For this application we have chosen to show a small two-by-two grid version of the AmuckSlider game board. You need two images to submit a game: One needs to be 57 x 57 pixels (Figure 3.19) and the other should be 512 x 512 pixels (Figure 3.20).
FIGURE 3.19
Small 57 x 57 icon used for AmuckSlider
FIGURE 3.20
Large 512 x 512 icon used by AmuckSlider
Caution
Apple suggests that the large icon should not be a stretched version of the small one. The large icon is displayed in iTunes and will not have the quality you will want to attract buyers if it is stretched and dithered. Also, there is a good chance your app will be rejected if you try to submit a stretched image.
Figures 3.21 and 3.22 show the images we used for AmuckSlider.
FIGURE 3.21
iPhone Home screen with AmuckSlider installed
FIGURE 3.22
AmuckSlider Game View after several rounds of polishing
Analyzing Business Aspects
You have planned, implemented, and polished—now it's time to reap some rewards. When its doors first opened, simply publishing an application to the App Store meant good sales. Now that the newness has worn off, the App Store is saturated with applications. A new strategy is needed. By analyzing the business aspect, you can learn how to use apps to your advantage.
Puzzle apps are generally less involved and thus less costly to write than other types of applications. Most puzzle apps are pattern driven. You generally only have to set up the engine and plug in several levels as simple data files. This will help you release many updates by simply adding levels. Be careful to keep this in mind when deciding on how to process your logic to make sure you can make small adjustments to the code or even allow the player to download new content.
Since puzzle apps are easy to create, they tend to dominate the market. Your game really needs to have something to set it apart and to excel in this arena. When building AmuckSlider, we looked at all the other slider