Game Development Reference
In-Depth Information
Reheated Resources
In order to save time (and paper), we have provided you with a new version of the game, which
contains all the new sprite and sound resources you'll need for this chapter. Although setting
these up is trivial, there are still a few things you should take note of, so we'll give you another
quick tour so that you don't miss anything crucial.
Exploring the Sprite Resources
•
Use Game Maker to open
zool7.gmk
from the
Chapter05/Games
directory on the CD
and take a look at the sprite resources. The
Zool
group now contains left- and right-
facing sprites for three new actions (kick, spin, and die), as well as a missile sprite for
shooting. Open up some of the new sprites and click on the
Modify Mask
button.
Notice that the new action sprites have
Precise Collision Checking
turned off and
share the same bounding box and origin settings as the previous Zool sprites (in order
to ensure that the collision area doesn't change when switching sprites).
•
Zool's missile sprite also has
Precise Collision Checking
turned off and has an
appropriately smaller bounding box set up. From now on, you can assume that we
have turned the
Precise Collision Checking
off and used
Rectangular
collision, unless
we specify otherwise. However, precise collision would actually work just as well in
this case, as Zool's missiles will get destroyed on contact with anything.
•
The
Platforms
group now contains a new group called
Lifts
, which itself contains all
the sprites needed for moving platforms later on. It is not practical to use tiles for
moving objects, so these sprites are used for both the collision mask and the visual
image of lifts. Most of these have their
Origins
at
X
=
0
,
Y
=
0
, and use the
Full image
option for the bounding box (which just means that the bounding box is the full size
of the sprite).
The new
Hazards
group contains all the hazards we will be adding in this chapter. First
comes a range of spikes in varying orientations. All of these use the
Full image
option for
the bounding box, which just means that the bounding box is the full size of the sprite.
•
•
Next comes six different sprites for the Sweet Beastie enemy. These all have
Manual
bounding boxes set up with identical boundaries (
Left
=
8
,
Right
=
24
,
Top
=
4
,
Bottom
=
43
). They also share the same
Origin
settings (
X
=
16
,
Y
=
28
), which are not at
the center of the sprite. This origin is offset in the y direction so that the base of the
bounding box rests on top of the platform's surface when the Beastie object is placed
in the room editor.
•
The collision settings for the die sprites and the splat sprite (further down) are
irrelevant, as they are only included for visual effect and we will not handle their
collisions.
•
The Beastie missile uses a
Rectangular
,
Full image
bounding box. It will be expected
to react to collisions and bounce across the landscape. In practice, you probably
wouldn't notice any difference using
Precise Collision Checking
in this case
(as the
missile is such a simple, solid shape and is unlikely to get stuck),
but
we'll keep to the
principle
that precise collision is the not the best choice for reactive collisions.
•
The collision and origin settings for the Jelly enemy sprites are different from the
Sweet Beastie, but follow identical logic.
•
The Bee enemy sprites are slightly different insofar as they do not need to rest neatly
on the surface of platforms, so their origins are in the center of the sprites.
Search WWH ::
Custom Search