vberegovoy Posted October 27, 2016 Share Posted October 27, 2016 Hi, I am new on Phaser framework actually, but i am trying to find out. I have an easy test game, where emitter moving from left to right, and drop particle, which is candy with 3 different state. So i have to click on particle, and it has to change animation frame. When i click 3 time, particle have to disapear. Here is my game code, but actually, i cannot make click event working. It looks like something wrong with my code, but i don't know where <script> function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } var game = new Phaser.Game('100%', '100%', Phaser.AUTO, '', { preload: preload, create: create, update: update }); var emitter; function preload() { game.load.spritesheet('waffle', 'waffle_sprite.png', 150, 150, 3); } function create() { // game.physics.startSystem(Phaser.Physics.ARCADE); emitter = game.add.emitter(game, 100, 100, 20); emitter.inputEnableChildren = true; emitter.onChildInputDown.add(onDown, this); emitter.gravity = 0; emitter.minRotation = -100; emitter.maxRotation = 100; emitter.setYSpeed(150, 300); emitter.setXSpeed(50, 50); emitter.makeParticles('waffle', 0); setInterval(function(){ emitter.x=getRandomInt((game.width * 0.1), (game.width - game.width * 0.1)); emitter.start(true, 5000, null, 1); }, 1000) } function update() { } function onDown (sprite) { console.log(sprite); } </script> Can you please help me fix click event on every child? Thank you! I will continue my developing after fix this issue. Link to comment Share on other sites More sharing options...
Manifest Posted November 28, 2016 Share Posted November 28, 2016 I'm also having the same issue. Link to comment Share on other sites More sharing options...
damien leroux Posted September 10, 2017 Share Posted September 10, 2017 Hello, It doesn't work for me neither. Any clues? Here is my emitter configuration: var balloonsEmitter = game.add.emitter(0, 0, MAX_NUMBER_OF_BALLOONS); balloonsEmitter.enableBody = true; balloonsEmitter.inputEnableChildren = true; balloonsEmitter.onChildInputDown.add(function (balloon, pointer) { balloon.kill(); //delete particle }); balloonsEmitter.gravity = 0; balloonsEmitter.makeParticles('balloonsPop', 0, 5); Link to comment Share on other sites More sharing options...
samme Posted September 11, 2017 Share Posted September 11, 2017 This is a bug. A workaround is emitter.type = Phaser.GROUP; Link to comment Share on other sites More sharing options...
samme Posted September 14, 2017 Share Posted September 14, 2017 Fixed in phaser-ce/releases/tag/v2.8.7. Link to comment Share on other sites More sharing options...
Recommended Posts