From zero to a complete game with Cocos2d HTML5 – Step 2: mouse interaction

Welcome to the second step of the complete game creation with Cocos2D HTML5. This time we are going to add mouse interaction.

In the original Circle Chain game you move a red circle with the mouse. With a mouse click you will destroy the circle which will split into four bullets flying up, down, left and right.

This is what we are going to do with today’s step. Starting from step 1, you only have to make some changes to circlechain.js file:

And this is what you’ll get:

Move the red circle with the mouse and click on the stage to make it explode.

Next time, I’ll show you the complete level with the chain reaction and I’ll fully comment the code.