winspeednl Posted June 8, 2015 Report 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? Quote Link to comment Share on other sites More sharing options...
winspeednl Posted June 9, 2015 Author Report Share Posted June 9, 2015 Bump Quote Link to comment Share on other sites More sharing options...
MichaelD Posted June 9, 2015 Report 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 Quote Link to comment Share on other sites More sharing options...
winspeednl Posted June 9, 2015 Author Report 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);} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.