Game Development Reference
In-Depth Information
We are going to go with the first option, so he is going to spawn an actor when
Kevin touches him. It's a crude but effective way of doing it. Create a new object that
will spawn from the
Walker
actor. It will be movable, but will have
0
Alpha
, which
will make it invisible because we don't want to see it. Then drag in an
Accelerate
behavior and change the speed to
500
, then a
Timer
behavior with
After
0.5
seconds
, and inside the Timer drag in a
Destroy
behavior.
Now let's go back into our
Walker
actor, past all the movement behaviors. Let's create
a new rule. This will be
Actor receives event
|
overlaps or collides
|
with
|
actor
of type
|
Kevin
; add a second condition which will be
Attribute
|
self.Graphics.
Flip Horizontally
|
is false
, then drag in an
Animate
behavior to show the attack,
and then a
Timer
. Change the Timer to
Every
0.2
seconds
, then inside the Timer
behavior, drag in a
Spawn Actor
behavior and select the actor you created to be
spawned. Copy and paste this section of rules and change them accordingly for facing
the opposite direction,
self.Graphics.Flip Horizontally
|
is true
, and change
the direction of the
Spawn Actor
to
180
.