Skip to content

Commit 111164e

Browse files
committed
If no seed was given in the Game config object, the RandomDataGenerator wouldn't be started (thank tylerjhutchison fix phaserjs#619)
1 parent ca91555 commit 111164e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Bug Fixes
8080
* Emitter.friction property removed and replaced with Emitter.particleDrag, which is now correctly applied.
8181
* ArcadePhysics.Body.reset incorrectly set the Body.rotation to Sprite.rotation instead of angle.
8282
* Emitter.emitParticle resets the rotation on the particle to zero before emitting it.
83+
* If no seed was given in the Game config object, the RandomDataGenerator wouldn't be started (thank tylerjhutchison fix #619)
8384

8485

8586
Updated

src/core/Game.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,15 @@ Phaser.Game.prototype = {
377377
this.physicsConfig = config['physicsConfig'];
378378
}
379379

380+
var seed = [(Date.now() * Math.random()).toString()];
381+
380382
if (config['seed'])
381383
{
382-
this.rnd = new Phaser.RandomDataGenerator(config['seed']);
384+
seed = config['seed'];
383385
}
384386

387+
this.rnd = new Phaser.RandomDataGenerator(seed);
388+
385389
var state = null;
386390

387391
if (config['state'])

0 commit comments

Comments
 (0)