Chapter 2, Exercise 1 – Removing Click Handlers

If you click in the game area a second time, the bubble appears back on the screen. How would you disable this click event to prevent it?

The simplest way is to unbind the event handler in the clickGameScreen function in game.js:

var clickGameScreen = function(e){
  var angle = BubbleShoot.ui.getBubbleAngle(curBubble.getSprite(),e);

See the jQuery documentation on unbinding for more:

Leave a Reply

Your email address will not be published. Required fields are marked *