TomLGD Posted October 11, 2015 Share Posted October 11, 2015 Hi guys, for my game i use a emitter (game.add.emitter) for a snowing weather effect. When i start the state the emitter starts as well. So it looks like it has just started to snow right at the moment the player starts the game. Is it possible to advance the emitter progress. So it looks like the emitter does its workfor a while? thanksTom Link to comment Share on other sites More sharing options...
jmp909 Posted October 12, 2015 Share Posted October 12, 2015 Post your emitter code snippet so we can see what's wrong. Thanks Link to comment Share on other sites More sharing options...
TomLGD Posted October 12, 2015 Author Share Posted October 12, 2015 Here is my Emitter Code:addSnowflakes: function(name) { if (isMobile) return; var emitter = game.add.emitter(game.world.centerX, -32, 600); emitter.makeParticles("atlas", ["snowflake", "snowflakebig"]); emitter.maxParticleScale = 1; emitter.minParticleScale = 1; emitter.setXSpeed(-10, 10); emitter.setXSpeed(2, 10); emitter.gravity = 0; emitter.width = game.world.width * 1.5; emitter.minRotation = 0; emitter.maxRotation = 0; emitter.start(false, 4000, 1);},I don't know how this helps cause its a general question about emitters^^ Link to comment Share on other sites More sharing options...
jmp909 Posted October 12, 2015 Share Posted October 12, 2015 I'm a bit confused. so your emitter is actually working? oh i see.... you want to essentially start as if the emitter had been running for a while. Link to comment Share on other sites More sharing options...
TomLGD Posted October 12, 2015 Author Share Posted October 12, 2015 right^^ Link to comment Share on other sites More sharing options...
jmp909 Posted October 12, 2015 Share Posted October 12, 2015 I can't see a way to do it in the codehttps://github.com/photonstorm/phaser/blob/858ad5161028d45d65679c88fc1e9a08ceed1f8f/src/particles/arcade/Emitter.js possibly you could speed up your game for a bit before showing it.. but that's going to cause a whole load of unknown side effectsgame.time.slowMotion = 0.001i tried fiddling with it herehttp://phaser.io/sandbox/edit/LlkfEvEx might be worth making a request for phaser 3.. regarding just being able to set the game physics time temporarily to calculate projected movement etc as well Link to comment Share on other sites More sharing options...
jmp909 Posted October 12, 2015 Share Posted October 12, 2015 (was also asked just over a year ago.. http://www.html5gamedevs.com/topic/9660-how-to-fast-forward-a-particle-emitter-on-load/) Link to comment Share on other sites More sharing options...
TomLGD Posted October 12, 2015 Author Share Posted October 12, 2015 One solution would be so "transfer" the emitter.Cause i will restart the state every time the user wants to play again.So the emitter is always reset and restarted.Is it possible to hold the current emitter state for reusing? Link to comment Share on other sites More sharing options...
jmp909 Posted October 12, 2015 Share Posted October 12, 2015 this is what Rich saidonEmit is called the moment they are _born_, so can definitely be used to alter immediate propertieshowever what I'd likely do is just set the Emitter to manualUpdate and then step through it as many times as you needthen put it back under plugin controlI think that latter part may just be for Particle Storm, as I don't see that option in Phaser codehttps://github.com/photonstorm/phaser/search?utf8=%E2%9C%93&q=manualupdate Link to comment Share on other sites More sharing options...
Recommended Posts