Game Development Reference
In-Depth Information
the previous scene. As you will re-use this for other blocks, I will show you how
to create a custom behavior.
Creating a Custom Behavior
Basically, to ensure that the target is not moving, you will reset to 0 all velocity
(linear and angular) as well as the rotation angle.
In the Level up rule, create a new group named ''No Movement.'' Use Change
Attribute behaviors to set the following (shown in Figure 7-31):
Self.Motion.Linear Velocity.X to 0
Self.Motion.Linear Velocity.Y to 0
Self.Motion.Angular Velocity to 0
Self.Rotation to 0
Figure 7-31. No movement
Now, click the Custom tab in the Behaviors library. Drag the No Movement
group over to the Behavior library, as shown in Figure 7-32.
Figure 7-32. No Movement custom behavior
That's it! You have created your first custom behavior. You will use this behavior
later.
 
Search WWH ::




Custom Search