Skip to content

Commit f4f4512

Browse files
committed
Fixed Math.RND assignment. Fix phaserjs#4197.
1 parent 1bf9be5 commit f4f4512

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/boot/Config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ var Device = require('../device');
1010
var GetFastValue = require('../utils/object/GetFastValue');
1111
var GetValue = require('../utils/object/GetValue');
1212
var IsPlainObject = require('../utils/object/IsPlainObject');
13-
var MATH = require('../math/const');
14-
var RND = require('../math/random-data-generator/RandomDataGenerator');
13+
var PhaserMath = require('../math/');
1514
var NOOP = require('../utils/NOOP');
1615
var DefaultPlugins = require('../plugins/DefaultPlugins');
1716
var ValueToColor = require('../display/color/ValueToColor');
@@ -370,9 +369,7 @@ var Config = new Class({
370369
*/
371370
this.seed = GetValue(config, 'seed', [ (Date.now() * Math.random()).toString() ]);
372371

373-
MATH.RND = new RND();
374-
375-
MATH.RND.init(this.seed);
372+
PhaserMath.RND = new PhaserMath.RandomDataGenerator(this.seed);
376373

377374
/**
378375
* @const {string} Phaser.Boot.Config#gameTitle - The title of the game.

src/math/const.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var MATH_CONST = {
5353

5454
/**
5555
* An instance of the Random Number Generator.
56+
* This is not set until the Game boots.
5657
*
5758
* @name Phaser.Math.RND
5859
* @type {Phaser.Math.RandomDataGenerator}

0 commit comments

Comments
 (0)