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

Understanding Box2D kinematic bodies

So you are used to work with Box2D and know everything about body types, such as static bodies and dynamic bodies… why nobody talks about kinematic bodies?

I think kinematic bodies are great to do some tasks, but first let me briefly explain the difference among body types.

A dynamic body is a body which is affected by world forces and react to collisions. And you already met a million of them.

A static body is a body which isn’t affected by world forces it does not react to collisions. It can’t be moved. Fullstop.

A kinematic body is an hybrid body which is not affected by forces and collisions like a static body but can moved with a linear velocity like a dynamic body.

So I made this little, commented script where dynamic spheres fall down at every second in a world full of moving kinematic bodies. The effect is unique and can be used in some games.

This is the result:

Also look how debug draw shows kinematic bodies.

Download the source code.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (8 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 5 comments

  1. Chris

    on May 12, 2012 at 12:23 am

    Wow, seriously!?

    I was going to introduce a game mechanic similar to this in my current game- was thinking about making the bodies I didn’t want affected by the others just incredibly massive, but was worried about the low mass objects going nuts when hit.

    This will help a lot, thanks!

    I am planning to go through all your box2d tutorials soon, since a lot of the stuff you’ve talked about can be combined into nice, unique mechanics.

    Have you ever thought of having a page with all your box2d AS3 tutorials listed on it?

  2. MC

    on May 13, 2012 at 1:49 am

    @Chris: Just visit http://www.emanueleferonato.com/category/box2d/

    Regards

  3. Arkshija

    on May 13, 2012 at 5:27 pm

    If u go top page and after w8ing some secs go back to game many balls falls at same time

  4. Emanuele Feronato

    on May 13, 2012 at 9:55 pm

    I know Arkshija, it’s because of:
    http://www.emanueleferonato.com/2011/03/29/pausing-a-flash-game-or-movie-detecting-its-focus/

  5. Nape?????? - Tomyail?????

    on February 24, 2013 at 2:18 pm

    [...] http://napephys.com/help/manual.html#Hello_Nape Understanding Box2D kinematic bodies [...]