HTML5 + Box2D hook like the one seen on iOS Mikey Hooks game

It’s being a long time since I showed you how to create a hook like the one used in Mikey Hooks using AS3 + Box2D and AS3 + Nape.

It’s still a great game concept, so let me show you how to create the same thing using Box2D + Phaser.

Despite being an extremely good looking effect, it’s very easy to create an hook using Box2D, you just have to play with distance joints.

Let’s have a look at what we are going to do in a few lines of code:

You can’t control the ball, but click and hold the mouse on a static green body to fire the hook, release to destroy it.

Here is the commented source code, have a look at it, you will be impressed about how easy can be the creation of this effect.

I have a minigame concept in mind to show you, meanwhile download the source code.

  • Hi emanuel,

    Sorry for my English, I wanted you to create an example of a simple game PLATFORM AS BOX2D And Phaser.JS with texture, and how the performance of this online?

  • Hey man, thanks for writing this post. It inspired me to do the first game in my 1 Game a Month challenge. I also coded my game in Phaser like your example, but the Box2D documentation is so hard to figure out, so I ended up using the P2 physics in Phaser instead. It works as a charm with the game.physics.p2.createSpring function which is also poorly documented, but Phaser documentation is improving. It’s my first game :) If you want to support me, you can rate it on Google Play compiled with CocoonJS): or just play it here:
    Thanks again for inspiring me. I look forward to more posts about games in general and Phaser in particular.

  • Pingback: Swinging Bird – #1Gam Dec 2015 | Sandway Games()