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

Circle Collisions

September 22nd, 2008

First tutorial in 9 months, so bare with me. :P

We are going to make a script that will make circles collide with each other. This would be very hard to do with hitTest()’s so we are going to use a small amount of trigonometry. Don’t let the big word or its meaning scare you. All we are going to need is 13 lines of code. Here is what it should look like:

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

Read the rest of this entry »