Game Development Reference
Easing to random positions and calculating velocity
Let's look at another practical example. In the chapter source files, open the N]j`kiPsaaj folder as
a project and test it. The nk^kp object eases to random positions on the stage. In addition, a dynamic
text field displays the robot's rt and ru velocities. Figure 10-11 illustrates what you'll see.
Figure 10-11. The robot eases to a random position on the stage, and a
dynamic text field displays its velocity.
Here's the code that makes it work. Except for the robot's velocity calculation, there's nothing really
new here. Read through the comments in the code, and see if you can match the way it's working with
what you see on the stage when the SWF runs: