Game Development Reference
4. Save the I]ej[>qc?]p_dan*]o file and test the project. The three bugs flutter randomly around
the stage and bounce off the edges very realistically (like flies bumping into windows).
There's no magic to any of this. You just combined a few things that you already know how to do in
ways you haven't seen before.
Dynamic instance variables
In the constructor method, you declared and initialized rt and ru variables for the bugs and added
AJPAN[BN=IA event listeners like this:
The rt and ru variables were created dynamically (they're called dynamic instance variables ). All
that means is that you needed these variables, so you created them on the spot without checking with
the object's class whether it was okay to do so. In fact, the bug objects don't belong to any special
class, except the general Ikrea?hel class.