Moving enemies

As a static enemy won't scare anyone, let's make enemies move.

With the knowledge you have at the moment, you would suggest creating spaceship_mc class and using an enter frame listener to update each enemy position. Most scripts relies on Event.ENTER_FRAME event is simultaneously dispatched to all DisplayObjects listening for it, so you don't have to synchronize animations.

That's true, but with many DisplayObjects to be updated, this technique although being the most correct from a programming point of view can dramatically increase the work of the Flash player.

In this game we won't deal with such an huge number of moving DisplayObjects to represent a risk for your CPU, anyway it's time to learn something new.

Add this new class ...

Get Flash Game Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.