We have reduced support for legacy browsers.

What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.

What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.

[Tutorial] Asteroids Ship

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](http://www.indieflasharcade.com/tutorials/SimpleShip.php)

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.

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.

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.

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;

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. ¬¬

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.

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

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](http://kongregate.com/games/IndieFlashArcade/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](http://kongregate.com/games/IndieFlashArcade/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: 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.

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](http://www.indieflasharcade.com/tutorials/SimpleShip.php)