Testing the Game


The most rewarding part of the game development process is seeing the end result of all your toiling over game code. In fact, one of the most exciting aspects of game programming is how you can experiment with tweaking the code and seeing how it impacts the game play. There admittedly isn't a whole lot to be tweaked on the Brainiac game, but it's nonetheless a neat game to try out now that the code is complete. Figure 8.2 shows the game upon initially starting out, which shows all the tiles hidden and ready for you to attempt a match.

Figure 8.2. The Brainiac game begins with all the tiles hidden, waiting for you to make the first tile selection.

graphics/08fig02.gif

When you click to select a tile, its image is revealed, as shown in Figure 8.3.

Figure 8.3. Clicking a tile reveals its underlying image, which lets you know what you're attempting to match.

graphics/08fig03.gif

After making your first move, the next step is to try and make a match by selecting another tile. Of course, on the first round of the game, this is essentially a shot in the dark. When you fail to make a match, you have to click once more to return the tiles to their hidden state and attempt another match. This gives you time to memorize the locations of the tiles you attempted to match. Making a match simply involves selecting the same two tiles, as shown in Figure 8.4.

Figure 8.4. Matching tiles involves selecting two tiles with the same bitmap image.

graphics/08fig04.gif

graphics/book.gif

You might be wondering why I selected tools as the basis for the graphics in the Brainiac game. The answer is that I've probably been watching too many home fix-it shows on television lately, so I just had tools on my mind. You could easily change the graphics to just about any theme you want: animals, cartoon characters , family members , you name it.


If you're one of those people who can recall the name of every classmate in your kindergarten class, you'll probably find the Brainiac game easy to master. Otherwise, you might just end up clicking aimlessly until you luck out on a few matches. Either way, the game will eventually end, and you'll be able to judge how well you've done by the number of tries it took to match all the tiles. Figure 8.5 shows the window that is displayed upon completing the game.

Figure 8.5. Upon completing a game of Brainiac, you are presented with a window that lets you know how many tries it took.

graphics/08fig05.gif

If you're the obsessive, competitive type, you will no doubt spend hours trying to get the number of tries down to a ridiculously low number. Or you might decide that Brainiac is nothing more than a light diversion on your path toward creating new and more interesting games . Either way, it's a good example of how to pull together a variety of different skills toward the creation of a complete game.



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net