From zero to a complete game with Cocos2d HTML5 – Step 3: chain reaction

Welcome to the 3rd part of the tutorial. In the 1st part I showed you how to install Cocos2D HTML5 and make it work with some stuff moving, in step 2 I added mouse interaction and now it’s time to create the chain reaction which is the main feature of the game.

Again, you only have to make small changes to circlechain.js file, the main change is handleBullet function which handles bullets movement and collision.

And this is the result:

Move the red circle with the mouse and click to start the chain reaction.

At this time the main engine is complete, so expect the full game in the next step.