Game Development Reference
In-Depth Information
Now just duplicate that rule we just created, and change it so the rule is
True
,
Accelerate
direction is
180
, and change the last
Change Attribute
to
false
instead of
true
.
Finally, at the end of the rule, in the
Otherwise
dropdown, drag in two Change
Attribute behaviors, both changing the
X
and
Y
values of
self.Motion.Linear
Velocity
to
0
, because we don't want Magellan to move before the boss battle begins.
Test it out to see if everything works properly. If it does, when Kevin reaches
Magellan, the fight will begin with him shooting into the air and moving back and
forth as he bounces off the ground.
We now want him to start attacking.
For Magellan's projectile, I recycled the star image by creating a new actor with it,
and just changed the color. Inside the new
Star
actor, drag in a
Move
behavior,
leave all the settings as the default values, and then drag in a
Particles
behavior if
you want to get fancy.
Back to Magellan! Inside the
Accelerate
rule, drag in a Timer behavior, and change
it to
Every
0.3
seconds
. Then drag in another Timer; inside it, drag in a
Spawn
Actor
behavior and select the new
Star
actor we just created, and change the
Direction
to
315
.
Do the same for the
Accelerate
rule, but change the
Direction
on the
Spawn Actor
to
225
. Test it out to see if it works. If it does, he will be bouncing back and forth,
shooting his stars at you as shown in the following screenshot: