Game Development Reference
In-Depth Information
Now let's go into our
Star
actor, make sure the
Movable
option is not selected. Then
create a new rule so that when Kevin collides with the star, this object is destroyed:
Now back into our
Kevin
actor, we are going to create a new attribute to detect that he
has collected the star. Click on the
+
button in the
Attributes
pane of our Kevin actor,
make the attribute a
Boolean
, and name it
Star
, or something easy to remember.
Next, create a new
Rule
and change it to
Actor receives event
|
overlaps or collides
|
with actor of type
|
Star
, then drag in a Change Attribute behavior into this rule,
change it to
Change Attribute:
self.Star
|
to:
|
true
.