javascript Posted August 10, 2015 Share Posted August 10, 2015 Click event fired only once, i don't know why, someone can help me. ThanksbubblesData.forEach(function(bubble, index) { var graphics = new Phaser.Graphics(game, 0, 0); graphics.boundsPadding = 0; graphics.beginFill(0x4E3794, 1); graphics.drawCircle(bubble.x, bubble.y, bubble.diameter); graphics.hitArea = new Phaser.Circle(bubble.x, bubble.y, bubble.diameter); var texture = graphics.generateTexture(); bubbles[index] = game.add.sprite(bubble.x, bubble.y, texture); bubbles[index].inputEnabled = true; bubbles[index].bubble = bubble; bubbles[index].events.onInputDown.add(puzzle.unfold, this);}); Link to comment Share on other sites More sharing options...
Recommended Posts