Game Development Reference
In-Depth Information
This thought experiment helped to isolate the collision participants whose categories and
masks need to be edited: player, trigger, border, and obstacle. You'll later add the spring to
the mixture as well.
Coincidentally, you'll be naming the corresponding collision categories as follows:
player
,
trigger
,
border,
and
obstacle
. The required collision categories and
masks are outlined in
Table 9-1
.
and ropes from colliding with triggers and borders while preserving
existing collision behavior
Editing Collision Categories and Masks
Let's start the editing process with the player. Open
Player.ccb
, and select the root node
(
CCSprite
). On the
Item Physics
tab, enter player in the
Categories
field, and enter the fol-
lowing in the
Masks
field:
trigger, border, obstacle
.
In order to create multiple independent category and mask labels, you have to separate
them with a comma. If you separate the tags with any other character—space, for in-
stance—you'll get a single combined label. You don't want a single “trigger border
obstacle” label like you see on the left side of
Figure 9-15
; you want three separate labels
like on the right side of
Figure 9-15
.
Figure 9-15
.
Labels you type into the Categories and Masks fields must be comma-separated to create indi-
vidual labels (like those shown on the right side)
The player is now set up to collide with triggers, borders, and obstacles.
Search WWH ::
Custom Search