This effect is a direct descendant of the
"Detect Mouse Angle" tutorial on www.virtual-fx.net
It is almost exactly the same code as the "Game Gun" tutorial on VFX.
The only changes from the "Game Gun" tutorial are the following:
In the "Game Gun", there is a movie clip called "user". In the StarGun, the "user" is referred to as the "target". (This serves the same purpose... the gun shoots at the user ... target ... same thing.)
Instead of being stationery, the gun's (x,y) coordinates are randomized. Each time the gun gets new coordinates, it shoots. In the "Game Gun", the gun shoots only at a preset interval. In the StarGun, the gun shoots continuously.
The "Star" movie clip is similar to the Game Gun's "Laser" shot movie clip. The only difference is, instead of checking for collision detection with the user, the "star" movie clip tests to see if it is within 50 pixels of the target. If it is, it them self-terminates using the "remove movie clip" actionscript command.
Other than that, all the code is identical to the
Game Gun. To understand how the rest works, download the "Game Gun"
tutorial, and the "Detect Mouse Angle" tutorial, which explain things in more detail.
by: