Creating a Multi-Directional Shooter
October 2nd, 2008
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:









October 3rd, 2008 at 12:34 am
Thanks for uploading and editing. You made it alot better.
October 3rd, 2008 at 11:05 am
No worries. I didn’t change any of the tutorial, I just made the look of it suit the blog.
October 3rd, 2008 at 10:48 pm
I just noticed a bug in the full code…
_root["Bullet"+i]._x = Ship._x+3;
and
_root["Bullett"+i]._x = Ship._x-20;
October 3rd, 2008 at 11:00 pm
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.
October 14th, 2008 at 5:06 am
Nah the reg. point is in the middle. So the ship._x and ship._y is good enough
November 17th, 2008 at 7:19 am
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
November 18th, 2008 at 3:28 pm
You would put it inside the onEnterFrame funtion. It would look something like:
onEnterFrame = function(){
…other code here…
if (root._score <=0) {
gotoAndPlay(6);
}
}