Move Enemy

Skills Covered

  • Challenge Project
  • Failing is Learning
  • Success is a Menace

Estimated Work Time

  • 20 Minutes

Consider this a challenge project! Before delving into the turorials on the following pages, I'd like you to try to move an enemy accross the stage as in the example below. You should be able to accomplish this if you've been following along with the tutorials.

It's OK, in fact, it's GREAT if you struggle with this challenge. If you fail, you learn. Think about it: When you've successfully completed the previous projects, have you gone back through each line of code to determine how or why you were successful?

Most people wouldn't. It's just part of human nature. When you succeed, it's because you're the best. There's no reason to go back through and analyze it. You're the best! But don't forget: Success is a menace; it fools smart people into thinking they can't lose.

When you fail.... well, that's when you learn! As you take on this challenge, and perhaps beat your head against the computer as you struggle through it, you'll be forced to analyze each statement of code to determine what it's doing, how it's working, or why it's failing. You'll learn.

Let me give you some hints about what you need to do:

  1. Create an enemy MovieClip
  2. Attach a single copy of enemy and set the x,y postion as part of the init function
  3. Create a moveEnemy function somewhat similar to the moveLaser function
  4. Call the moveEnemy function the same place you call the moveLaser function

You'll need to click the movie with your mouse, then use your keyboard to move and fire:

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player