Game Development Reference
In-Depth Information
obj_slope
(grey) —Slopes are just steeper ramps that are made of ice, and therefore
slippery. Again, you'll find the actual slopes that are placed on the level (and
have the sloped collision masks) in the
Slopes
group.
obj_solid
(no sprite) —This is a parent object that is used for all objects that are
considered to be solid parts of the landscape.
8.
Notice that all the objects in the
Ramps
group have
obj_ramp
set as their parent and all
the objects in the
Slopes
group have
obj_slope
set as their parent. You can think of this
kind of parent relationship as meaning “a kind of.” So all the ramps are “a kind of”
obj_ramp
and all the slopes are “a kind of”
obj_slope
.
9.
There are more “a kind of” relationships set up for the other types of collision objects.
The
obj_slope
object (which represents icy slopes) has
obj_ramp
set as its parent
because slopes are “a kind of” slippery ramp. Both
obj_ramp
and
obj_ledge
have
obj_platform
as their parent because they are “a kind of” platform. Finally, both
obj_platform
and
obj_wall
have
obj_solid
as their parent because they are “a kind of”
solid object. Figure 3-5 shows the complete hierarchy of parent relationships used for
the landscape objects. Take a good look at this and make sure that the parent
relationships make sense to you before continuing.
10.
Crucially, this makes it possible to consider collisions with objects that are “a kind of”
something. For example, a collision with
obj_solid
now includes every kind of
landscape object, and a collision with
obj_platform
would include everything apart
from walls.
Figure 3-5.
The hierarchy of “is a kind of” relationships as defined by the parent settings of each object
Search WWH ::
Custom Search