Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

An one-button way to control the player coming from the past – Box2D version (introducing friction joints)

This is a quick attempt to port the engine of the one-button way to control the player coming from the past using Box2D, introducing for the first time the friction joint, a type of joint which is poorly explained in the tutorial you can see around the web, and it’s a pity because it’s very useful when you have to handle with top down simulations.

Basically I created a world with no gravity, then I created a friction joint between the ball controlled by the player and the “ground”, in this case the world body.

The final result is a lot more realistic than any other result you can achieve using linear damping or other tricks.

This is the source code:

and this is the result:

You know how to “play”: press and keep the mouse pressed to move the ball with a given direction and speed. Also look at the friction joint in the debug draw.

Download the source code

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has one comment

  1. Dex

    on May 6, 2012 at 3:13 am

    I love where this is going! Please, continue with the series :)