Game Development Reference
Figure 2-23 . The Expression Editor icon
This will open the Expression Editor shown in Figure 2-24.
Figure 2-24. Expression Editor
Select the Random (min, max) function by clicking on the insert function drop-
down menu and replacing the min with -45 and the max with 45. By doing so,
the ball will go in a direction between -45 degrees and +45 degrees. Then, click
the green check mark to actually insert the function. Figure 2-27 provides a
visual representation of the angles.
Figure 2-25. Ball direction (-45, +45)
Drag another Change Velocity behavior in the Otherwise section, which can be
accessed by clicking the arrow in front of the Otherwise text on the bottom of
the rule, and change the direction value to Random (135,225) and click the
green check mark. Figure 2-26 provides a visual representation of the angles.