Hardware Reference
In-Depth Information
Figure 6-2:
he two basic
Pie Man sprites.
Now with those two basic sprites, make copies of each pointing in the four directions. You can do
this by using the Rotate function or the Flip Horizontally and Vertically function of your graphics
package. When you have done this give them the names shown in Figure 6-3. Figure 6-3 also
shows how you are going to use the sprites in the code. he numbers from zero to seven point at
a diferent image, with the least signiicant bit of the number determining if the lid is open or
closed, and the two most signiicant bits determining the direction Pie Man is pointing.
Next you need to consider the ghosts. I used six steps in the animation sprites for the ghosts.
Basically the only change that happens from sprite to sprite is the position of the eyes and the
ripple of the “skirt” at the bottom. In the game these are run in a shuling loop - that is, they are
used in the order 1 to 6 and then back from 6 to 1. In this way you don't have to worry about any
discontinuities between sprites 1 and 6. You need three sets of ghost sprites, one set being blue
and the others red and orange, or two other colours. his is easy in Photoshop. First I selected
the eyes, and then inverted the selection so that the eyes were the only things not selected. hen
I used the Change Hue function to change the ghost colour. Finally, you need a set of ghosts for
the ghost dying sequence. I used a set of eight ghosts, all derived from the irst blue ghost. I took
the irst ghost and shifted it down about three pixels, and carried on doing that in successive
ghost sprites until the eyes reached the bottom of frame. hen I added more and more transpar-
ent pixels to the last few ghosts to give a fading-away efect. I went back to the irst “sinking”
ghosts and added a few transparent pixels to the body, putting more transparent pixels in subse-
quent frames. When played back this gave a nice dissolving efect. In order for the ilenames to
match up to the programs, the ghost's names are made from g for ghost, a number for the num-
ber in the sequence and inally a letter indicating the colour. hese are shown in Figure 6-4. he
dying ghost sequence is shown in Figure 6-5; these sprites are named similarly with a d for die as
the last letter. Note that all the sprites should have a transparent background and they need to
be put into a folder called pies , alongside the sounds folder.
Search WWH ::




Custom Search