Game Development Reference
To use the Psaaj class, you need to import some new packages and classes into the I]ej[>]oe_Psaaj
class. The Psaaj class and the a]oejc package that contains the formulas create the easing effects:
You might be wondering what the asterisk is doing after the dot in the directive that imports the
a]oejc package. It instructs the program to import every class in the a]oejc package. Normally you
would not want to do this. For matters of clarity, it's usually best just to import the classes you need,
but in this case, there are a lot of classes in the a]oejc package that you'll want to experiment with,
so it saves you a bit of trouble of having to import them one at a time.
In the preceding class, an instance of the Psaaj class called [psaaj was created. You need to provide
the Psaaj class with six parameters when you create a new Psaaj instance:
As you can see, it's packed with information. It might look a bit disorienting at first glance, but it's
pretty straightforward if you break down the arguments it contains one piece at a time. Figure 10-10
is a diagram that explains what the information in the arguments represents.
Whether to use frames
or seconds for the
animation's duration. If
false, the duration will
be in frames.
The object you
want to animate.
The effect that you want to
use to animate the object.
Name of the
The object's property that
you want to animate.
The duration of the
animation in frames
Figure 10-10. The arguments you need to supply to create a new Tween instance
As you can see, it's really just a detailed list of information that the Psaaj object needs to create the