Game Development Reference
In-Depth Information
The platforms and lava flows will also require beginning, middle, and end sprites so that they
can be made to any length we need. As a result, you will find a total of 16 different sprite images in
the Chapter02/Resources directory on the CD, that are ready for you to use to make the game.
Have a quick look through these and notice that they are all .png files and many of them contain
multiple frames of animation (as indicated by _stripXX at the end of the file name). In the same
folder, you will also find a .bmp file that holds the background image for the levels and a number of
.wav and .mp3 files containing sound effects that we will use to add atmosphere to the game.
Note We're going to begin by creating all the sprites for the game and a simple test room to work with.
This is quite a simple and repetitive task, but we've included instructions on how to do it for the sake of
completeness. Nonetheless, if you are a confident Game Maker user, then you might want to just read
through the first couple of subsections without actually carrying out the step-by-step instructions. When
you reach the section on State Machines, you will be provided with a version of the game that has the
sprites and test room already set up for you. Make sure you do read the text, though; otherwise, you will
miss out on important concepts that we will refer back to later!
Sprites
We will begin by preparing all of the sprites needed for our game. You should certainly already
know how to load sprites into Game Maker, but here's a brief reminder in case you've forgotten.
Note If you've been using an earlier version of Game Maker, then you'll notice that the sprite properties
form is a little different in Game Maker 8. Don't worry, we'll explore its new features shortly. However, if
you've still not upgraded, then now is the time to do it—you'll find the Game Maker 8 install program in
the Program folder on the CD.
Creating and Loading a New Sprite
1.
Select Create Sprite from the Resources menu (you can also create sprites by right-
clicking on the Sprites folder in the resource tree, or using the little red Pac-Man
button on the toolbar).
Click the Load Sprite button and open the first sprite from the Chapter02/Resources
directory (that is, spr_gold_strip30.png ).
2.
3.
Click on the Name field and enter the same name as the file name, but without the
_stripXX.png part at the end (that is, spr_gold ).
4.
Click Center (under Origin ) to move the reference point from which the sprite is
positioned to the center of the image.
5.
Click OK to close the Sprite Properties form.
 
Search WWH ::




Custom Search