Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A somewhat separate part of the ship is the shield. It exists as a movie clip inside of the ship movie clip. So, to turn it on, we just need to set its visible property to true. A timer is set to turn off the shield in three seconds. In the meantime, shieldOn will be set to true, so any passing rock collisions will be ignored.
Note
|
| The shield is actually a semitransparent graphic that allows the ship to be seen through the shield. It has Alpha settings applied to the colors used in the gradient of the shield. No ActionScript is needed for this; the graphic is just drawn this way. |