David Danielsson sent in a tutorial. It’s so you can make something shoot left and right, like in a sidescrolling shooter. You can add a bit of code to it to make it shoot in 4 directions easily though. Here it is:

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Furl
  • Slashdot
  • StumbleUpon
  • Technorati

7 Responses to “Creating a Multi-Directional Shooter”

  1. David Says:

    Thanks for uploading and editing. You made it alot better.

  2. awesty Says:

    No worries. I didn’t change any of the tutorial, I just made the look of it suit the blog. :)

  3. David Says:

    I just noticed a bug in the full code…
    _root["Bullet"+i]._x = Ship._x+3;
    and
    _root["Bullett"+i]._x = Ship._x-20;

  4. awesty Says:

    Well it should really be:
    _root["Bullet"+i]._x = Ship._x + Ship._width / 2;

    But it won’t really make that much of a difference.

  5. David Says:

    Nah the reg. point is in the middle. So the ship._x and ship._y is good enough

  6. Mike Says:

    Hey guys, I know this is off topic, but… I’m not sure how you would put this code in a frame, not a movie clip:

    if (root._score <=0) {
    gotoAndPlay(6);
    }
    ————————————————-
    Yeah, I know I’m stupid and I know I’m bad at coding but if someone could show me how to put this in a frame that would be great. Or even if they could change it if they know what I’m talking about :|, but whatever.

    P.S. I’m working in AS2

  7. awesty Says:

    You would put it inside the onEnterFrame funtion. It would look something like:

    onEnterFrame = function(){
    …other code here…

    if (root._score <=0) {
    gotoAndPlay(6);
    }
    }

Leave a Reply