IndieFlashAr...
433 posts
|
I’ve re-done my tutorial for making an Asteroids-style space ship in Flash. I’m hosting it on my Web site, if you’re interested in learning how to make a space ship in flash, check it out::
http://www.indieflasharcade.com/tutorials/SimpleShip.php
|
|
|
Eggy
1434 posts
|
Oh my god!! WEBSITE SPAMMING BAN BAN BAN BAN BAN BAN BAN BAN.
Joking, If you wanna find out why he’s website spamming you can by visiting my site at www.eggysgames.com and paying a 0.99 deposit through paypal.
KIDDING, please don’t kill me, I really am sorry.
Ahem, Indie nice tutorial. Might needa explain some bits more in detail such as how the speed is adding together ect but yeah.
|
|
|
Nqkoi1
3753 posts
|
Isnt tis pretty much site advertising
|
|
|
IndieFlashAr...
433 posts
|
I’m not advertising my site, and for your information people post links all the time to their own sites on this forum. Perhaps you’re just new here?
I’ve been on this forum for a long time, and I’ve read every post. Maybe it would be a good idea for Nqkoi1 to A) Read the freakin forum before spouting off, and B) Learn how to form a complete written sentence.
|
|
|
IndieFlashAr...
433 posts
|
You should just be happy that I took the time to write something down to try and help Flash beginners, and I’m paying to host it for you. If it doesn’t get a good resonse then I’ll just delete it like I deleted the original; it’s not a thing for me either way, I already know how to do it, I’m just helping out some beginners hopefully.
|
|
|
ch00se
98 posts
|
I think this is great. Don’t let the haters get to you. And personally, even if you are getting any benefit from people going to your site from this (which you probably are not, or are very little), more power to you.
|
|
|
AdamSchroeder
102 posts
|
Thanks for creating this Indie. I know a lot of people will find this very helpful!
I ran through the example and I was thinking it would even be better if you added some simple friction.
//apply friction
xVelocity=xVelocity * .95;
yVelocity=yVelocity * .95;
//move the ship
mcShip._x += xVelocity;
mcShip._y += yVelocity;
|
|
|
notorious
73 posts
|
Great tutorial! Only one question: why does it have to drawn pointing right?
Oh, and Indie, don’t let Nqkoi get to you, he’s just spamming useless one-sentenced posts all around the forum… Maybe, in his head, he thinks that a high post count will actually help him on his quest to becoming a Kongregate mod. ¬¬
|
|
|
Retron
477 posts
|
I agree 101%, notorious. Nqkoi1 is really posting semi-spam around the forums. By the way, nice tutorial IndieFlashArcade.
|
|
|
IndieFlashAr...
433 posts
|
notorious:
The reason for that is the rotation math. If you drew the ship pointing straight up, you could compensate by subtracting 90 from your degrees before doing the velocity calculation.
|
|
|
MnMn87
53 posts
|
There’s no friction because that’s not how Asteroids is played. I pointed my ship straight up and held down the thrust for a while and eventually it was going so fast or something that it didn’t even get shown on the screen. As for Nqkoi1… bleh.
|
|
|
MetroidEscapes
147 posts
|
This is a really really really helpful game for a AS newb like me =P
Is it possible you can make a tut for a random rocks coming out of no where…Like the real Asteroids game. It can be really helpful for a…programming newb like me. =P
|
|
|
IndieFlashAr...
433 posts
|
MetroidEscapes:
It’s easy to add asteroids once you understand the concepts presented in the tutorial. You will need to have an asteroid MovieClip in the library, and set the export options (linkage) like you did with the ship. Then you will need to generate a random x,y coordinate for the asteroid. Let’s say you have a 500×500 Stage size. Your code would be:
var newX:Number = Math.random() * 500;
var newY:Number = Math.random() * 500;
Now once you have an x,y coordinate for your asteorid, you can place it on the Stage. Let’s assume your asteroid is exported as “asteroid” from the library. You will use the code:
var newAsteroid:MovieClip =
this.attachMovie(“asteroid”,“newAsteroid”,this.getNextHighestDepth(),{_x:newX, _y:newY});
Of course, you will need to figure out some kind of way to make the asteroids appear one after another. I suggest looking up the setInterval() function and doing it that way. Unfortunately, building a game like Q-Zoid is way beyond the scope of this tutorial… so hopefully you can get an idea of how much work goes into even a simple game like Q-Zoid.
Hope that helps!
As an AS beginner, I would recommend that you buy a good ActionScript book, and read it cover to cover. While I hope that my tutorial helps you, I know it can only do so much…
|
|
|
notorious
73 posts
|
Indie, any suggestions of good books? I always wanted to learn how to work on flash, but never knew how to start…
|
|
|
Crushproof
497 posts
|
It’s nice, but there’s an asteroids ship that comes in an example .fla with Flash MX that handles much better. Pretty sure it uses less code too.
|
|
|
MetroidEscapes
147 posts
|
Aw, thanks alot Indie. I don’t really have the time for AS script books. I’ll just self-teach myself and learn piece by piece.
|
|
|
IndieFlashAr...
433 posts
|
notorious: I like the flash actionscript Bible, it’s a great book for general reference and familiarizing yourself with Flash.
Adam: Thanks for the suggestion, I think I’ll add some friction as an afterthought to the example, and explain what the code does a little better.
This is the first of a series of tutorials that I plan on making for Flash. I’ll post some links to the forums here when they’re done.
|
|
|
IndieFlashAr...
433 posts
|
I updated the tutorial, added an explanation of the code, and also Adam’s suggestion for friction.
It can be found here:
http://www.indieflasharcade.com/tutorials/SimpleShip.php
|