Platform engine using Box2D – Step 2

After publishing Platform engine using Box2D, my attempt to replicate the Rick Triqui‘s main character continues.

Now you can move the guy with left and right arrows, aim the bazooka with the mouse and shoot a bullet clicking on the mouse.

The bazooka isn’t a Box2D object because I didn’t need to include it into the physics world, so it’s just a sprite, like the pills in Mazeroll game.

This is the source code, still uncommented (I’ll made the tutorial when I’ll have the character jumping and textured)

And this is the result:

Left/Right to move, mouse to aim and shoot.

Download the source code and enjoy.

  • New

    Oh that’s awesome.

  • Hey I’m working on a platform engine as well in Box2D. Well, a cleaner version of Box2D called QuickBox2D, and I kinda need some help.

    When my character (a circle) is on a slope, how do I get the ball to stop sliding down the hill (it’s not rolling, i set fixed rotation). Setting the friction to 1 on the ball and the ground slows the ball’s speed going up the slope, but it does stop the sliding. And changing the ball’s Y linearvelocity to 0 when to the ball is on the ground also slows it’s movement on the slope…

    What do I do?

  • Bass

    there’s no source code attached :)

  • aseneo

    where is the download link? :)

  • You’re supposed to paste the code in the timeline…

  • Agadoijo

    Really looking forward for all tutorials related to making a platform engine with Box2D.
    Do you think it would be possible to make a simpler version of a game like LittleBigPlanet? It would require lots of stuff… but it would be really fun!
    Hopefully your tutorial will have scrolling, moving platforms and “ropes”! :D

    Keep up the awesome work!

  • Pingback: A Freelancer’s Flash Bash [4] | Freelance Flash Games News()