Step 6: Enemy Movement

Just as you can rename alterable values and strings, you can rename global values and strings. Check the Application properties, you will notice Global Value A has been renamed Enemy Direction.

We are storing the direction in a global string, as opposed to the built-in direction value of each Enemy, so that all Enemy objects will move in the same direction.
When any single Enemy object is within 30 pixels of the window edge, the direction of all Enemy objects will be reversed. If you test the application, you will notice that the wing objects are constantly lagging 1 pixel behind the movement of the body object. Pictured below...


This is because MMF2 executes all events sequentially and we positioned the wing objects and then moved the body. Simply move these 4 events above the 2 events we made in Step 3 to fix the problem.
9