winspeednl Posted June 8, 2015 Share Posted June 8, 2015 Hi, I have a tilemap with multiple blocks of a kind (lava) and i want the all to have a particle system the group (lavaGroup) contains sprites.how can i let every lava block emit particles? Link to comment Share on other sites More sharing options...
winspeednl Posted June 9, 2015 Author Share Posted June 9, 2015 Bump Link to comment Share on other sites More sharing options...
MichaelD Posted June 9, 2015 Share Posted June 9, 2015 If you look at this example you'll see that the emitter lives inside the constructor, this way each lavaGroup can have an emitter. Just create a constructor with your group and sprites for each lavaGroup. http://gamemechanicexplorer.com/#homingmissiles-3 Link to comment Share on other sites More sharing options...
winspeednl Posted June 9, 2015 Author Share Posted June 9, 2015 Got it!for (var e = 0; e < lavaGroup.children.length; e++) { emitter = game.add.emitter(lavaGroup.children[e].x+tileSize/2, lavaGroup.children[e].y+tileSize/2, 1); emitter.makeParticles('particle-fire'); emitter.gravity = 250; emitter.minParticleSpeed.setTo(-25, -150); emitter.maxParticleSpeed.setTo(25, -250); emitter.setScale(0.5, 0.25, 0.5, 0.25, 6000, Phaser.Easing.Quintic.Out); emitter.start(false, 8000, Math.random()*10000);} Link to comment Share on other sites More sharing options...
Recommended Posts