Prototype of a Flash game like Meeblings

You should all known Meeblings and the sequel, Meeblings 2.


You have to help the Meeblings (cute creatures I’d love to burn alive) reaching the exit using some special abilities.

One of such abilities attracts Meeblings when you click and hold the mouse on a special Meebling.

In the prototype you are about to see, derived from the basic HelloWorld Box2D example, there are 10 randomly placed balls with different masses.

When you click and hold anywhere on the stage, every ball in a 4 meters radius (read this post and this post too if you don’t know how to convert meters to pixels) will be attracted towards the mouse pointer.

The more the distance, the stronger the attraction.

The only new, interesting line is line 78 where I apply an impulse as strong as the distance between the ball and the mouse, once I checked the player is holding mouse button and the distance from the ball and the mouse is less than 4 meters.

Look how I divide dist_x and dist_y by different numbers to balance gameplay.

This is the result:

Meeblings 2 level, meanwhile download the source code and enjoy.

  • Would it be possible to have a restart button on your demos ?

    I have to reload the whole page everytime. It would lower your bandwith use.

  • Emanuele, you could wrap a container div around each .swf. Make a small button/div above the .swf, and with a little javascript ‘onClick’ change the container div’s sytle display to none, and the bttn txt to .

    This would effectively give users a reset AND allow dial-up’s & slow processors to ‘turn off’ swf’s when they are done with them.

    @Monkios: if you use firefox, get firebug, and you can do what I’ve described above to any website. display=none (off) display=block (on)

  • Kieran Lord

    Is it difficult to have something like this, but have some of the objects unable to rotate?

    for example… having some “magnetized” boxes for a platforming game.

  • im just making a new box2d game, id like to know how to make “donate” button

  • hi everyone,

    check out my first box2d game just write in google minitrain game and play

    controll is a little bit tricky, but as i sad, it was my firt box2d appliction

  • not the best, but pretty cool. let me know where your takin this, cuz meeblings gets old after like 12 minutes or so. could be prommising