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) {
, but whatever.
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
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);
}
}
January 20th, 2009 at 9:40 pm
hey i know this is off topic but i dont know where else to put it (seeing as the old site is dead). Iv’e been trying to create a platformer game in which there are also enemies, ive tried combining some of the code from 2 of your old tutorials but i cant get him to jump
anyway this is the code on the main “man” MC
onClipEvent(load){
fight = false;
}
onClipEvent(enterFrame){
if(fight == false){
if(Key.isDown(Key.LEFT) && fight != true){
this._x -= 12;
this._xscale = -100;
this.gotoAndStop(3);
}else if(Key.isDown(Key.RIGHT) && fight != true){
this._x += 12;
this._xscale = 100;
this.gotoAndStop(3);
}else{
this.gotoAndStop(2);
}
}
if(Key.isDown(Key.SPACE)){
this.gotoAndStop(4);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
}
onClipEvent(load){
var jump:Number = 0;
var jumping:Boolean = false;
var falling:Boolean = false;
var g:Number = 10;
}
onClipEvent(enterFrame){
if(jumping == true || falling == true){
this._y -= jump;
}
if(jumping == false){
if(!falling){
jump = 0;
}
if(Key.isDown(Key.UP)){
jump = 15;
jumping = true
}
}
if(jumping == true){
jump -= 1;
}
if(jump <= -10){
jump = -10;
}
for(i=0;i<g;i++){
if(jumping == true && this.hitTest(_root["ground"+i])){
jumping = false;
}
}
for(i=0;i<g;i++){
if(!jumping && !this.hitTest(_root["ground"+i]) && !falling){
falling = true;
this._y -= 1;
}
}
if(falling == true){
for(i=0;i<g;i++){
if(this.hitTest(_root["ground"+i])){
falling = false;
}
}
jump -= 1;
}
}
I know it is probably useless but its the best i could do, and if you do decide to help me and you need more info email me at Phill.rulerofyou@gmail.com
March 26th, 2009 at 4:55 pm
Okay I know this is not in the right tutorial, but I couldn’t find any tutorial about this
anywhere,and your old site died,
and I need your help.
How do you make a bar go up when you touch something? Not down.
March 26th, 2009 at 5:03 pm
oh nevermind, I solved it
March 27th, 2009 at 6:48 am
Ok this is off topic but…
how do I make the character
move up with W
down with S
Left with A
and
Right with D
Ignore the posts I made above.
March 11th, 2010 at 6:12 am
i need help with that too. something about 65=a, etc?
July 30th, 2010 at 9:56 am
When i do this, it only shoots right
and when i press another button, it doesnt shoot at all?
December 1st, 2010 at 9:50 pm
You’ve written a very well-written blog post.
If it’s fine with you, I would like to seek permission to use your article as it relates to my problem. I will be glad to negotiate to pay you or hire you for this.
With Regards from
Republic Polytechnic
December 3rd, 2010 at 4:28 am
electronic cigarettes are the greatest thing to ever hit the market for smokers, I wasn’t even trying to quit regular cigarrettes. I intended to use the electronic cigarette to smoke more places and more often. within a week I could no longer stand cigarettes.
January 29th, 2011 at 4:51 pm
I like this blog so much, saved to fav.
October 15th, 2011 at 5:28 am
Thank you for taking time to write this post. It’s been very valuable. It couldn’t have come at a greater time for me!
October 31st, 2011 at 7:14 pm
You realize in which press button from the elevator that has a fireman’s hat on there? Ends up that’s DEFINITELY NOT the key anyone press in order to get some sort of fireman’s cap.
December 14th, 2011 at 6:10 pm
Its like you read my mind! You seem to know so a lot about this, like you wrote the book in it or some thing. I feel that you simply could do with some pics to drive the message house a bit, but other than that, this is great weblog. A great read. Ill certainly be back.
December 15th, 2011 at 7:00 pm
Rokit has a wide range of coats, denims, Hawaiian and Cuban shirts at the same time as scarves, tracksuits and theiraccessories make the outfit complete. Belts, jewelry, sunglasses and some very extraordinary watches supportcolour you want, and that it’s uncomfortable and not ideal for if you want to use it. It makes perceptiontraditional bars.The New Town also has its fair share of pubs and bars with most of them lining Rose Streetgoes.They apparently used the capital amount to buy a thousand meters of white cotton that they then made brand High Street stores, spouse and children run businesses, luxurious designer shops and speciality shops to chose from.paying off a mortgage – most peoples largest debt – can often take up to 20 years, all too often consumersAdventure and Outdoor SportsDublin has a wonderful and diverse landscape that offers an excellent platformfrom 11am to 12 midnight and on Sundays from 12.30 to midnight. Nighclubs stay open into the early hours andand two twenty year old shopping daughters. When I came to write this post, I therefore went to them for
December 18th, 2011 at 5:38 pm
Keep up the good work, I read few content on this web site and I believe that your website is really interesting and contains bands of wonderful info.
December 19th, 2011 at 5:09 am
almost certainly quite possibly the most handy to youat any time you likewise as your husband too as your youthful children go Canada Goose Jakke taught concerning the means in the productionIts main production is winter season clothingIn the workshop of Canada
December 22nd, 2011 at 3:01 pm
Our Furniture Store has one of a kind living room, bedroom, dining room, and patio furniture. For those who cannot get a hold of modern furniture in their state, you should definitely consider us to be your provider. People from the Midwest, this means you! We would like to invite you to browse our huge selection of modern sofas, platform beds, contemporary dining sets, and cool looking patio furniture. Our furniture stores are located in Los Angeles, but we ship nationwide to big cities like Dallas Atlanta New York New Jersey Chicago Miami and Las Vegas. Some of our furniture is eligible for free shipping nationwide. Please do not hesitate to call LA Furniture Store and speak to one of our friendly customer service representatives who are standing by.
good story, all laid out on the shelves
December 29th, 2011 at 2:22 am
I’ve read some just right stuff here. Certainly worth bookmarking for revisiting. I surprise how much attempt you set to create the sort of great informative site.
January 21st, 2012 at 9:55 am
Thank you so much pertaining to giving me an update on this topic on your website. Please be aware that if a completely new post appears or if any alterations occur with the current posting, I would be interested in reading more and knowing how to make good using of those techniques you discuss. Thanks for your time and consideration of other individuals by making this web site available.
March 12th, 2012 at 5:26 am
Can I simply just say what a comfort to uncover an individual who really knows what they are talking about online. You certainly understand how to bring a problem to light and make it important. A lot more people have to look at this and understand this side of your story. I can’t believe you aren’t more popular because you surely possess the gift.
March 27th, 2012 at 12:36 pm
,
April 15th, 2012 at 9:46 pm
hello!,I like your writing so so much! share we be in contact more about your post on AOL? I need an expert in this area to unravel my problem. Maybe that is you! Taking a look ahead to peer you.
May 17th, 2012 at 7:22 am
Very good article! We will be linking to this particularly great article on our website. Keep up the great writing.