Skip to content

Commit cdfe2e0

Browse files
committed
Fixed references
1 parent a6303aa commit cdfe2e0

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/gameobjects/container/Container.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var Container = new Class({
126126
* @private
127127
* @since 3.4.0
128128
*/
129-
this.addCallback = this.addHandler;
129+
this.addCallback = this.addHandler.bind(this);
130130

131131
/**
132132
* A callback that is invoked every time a child is removed from this list.
@@ -136,7 +136,7 @@ var Container = new Class({
136136
* @private
137137
* @since 3.4.0
138138
*/
139-
this.removeCallback = this.removeHandler;
139+
this.removeCallback = this.removeHandler.bind(this);
140140

141141
/**
142142
* A reference to the Scene Display List.
@@ -151,9 +151,9 @@ var Container = new Class({
151151
this.setPosition(x, y);
152152
this.clearAlpha();
153153

154-
if (Array.isArray(children))
154+
if (children)
155155
{
156-
this.addMultiple(children);
156+
this.add(children);
157157
}
158158
},
159159

@@ -196,7 +196,7 @@ var Container = new Class({
196196
* @param {Phaser.GameObjects.Container} list - The List the Game Object was added to (also this Container)
197197
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just added to this Container.
198198
*/
199-
addHandler: function (list, gameObject)
199+
addHandler: function (gameObject)
200200
{
201201
gameObject.on('destroy', this.remove, this);
202202

@@ -209,7 +209,7 @@ var Container = new Class({
209209
gameObject.parentContainer.remove(gameObject);
210210
}
211211

212-
gameObject.parentContainer = list;
212+
gameObject.parentContainer = this;
213213
}
214214
},
215215

@@ -223,9 +223,9 @@ var Container = new Class({
223223
* @param {Phaser.GameObjects.Container} list - The List the Game Object was removed from (also this Container)
224224
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just removed from this Container.
225225
*/
226-
removeHandler: function (list, gameObject)
226+
removeHandler: function (gameObject)
227227
{
228-
gameObject.off('destroy', list.remove, this);
228+
gameObject.off('destroy', this.remove, this);
229229

230230
if (this.exclusive)
231231
{

src/gameobjects/particles/ParticleEmitter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var DeathZone = require('./zones/DeathZone');
1111
var EdgeZone = require('./zones/EdgeZone');
1212
var EmitterOp = require('./EmitterOp');
1313
var GetFastValue = require('../../utils/object/GetFastValue');
14-
var GetRandomElement = require('../../utils/array/GetRandomElement');
14+
var GetRandom = require('../../utils/array/GetRandom');
1515
var HasAny = require('../../utils/object/HasAny');
1616
var HasValue = require('../../utils/object/HasValue');
1717
var Particle = require('./Particle');
@@ -943,7 +943,7 @@ var ParticleEmitter = new Class({
943943
}
944944
else if (this.randomFrame)
945945
{
946-
return GetRandomElement(this.frames);
946+
return GetRandom(this.frames);
947947
}
948948
else
949949
{

src/tilemaps/components/Randomize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
var GetTilesWithin = require('./GetTilesWithin');
8-
var GetRandomElement = require('../../utils/array/GetRandomElement');
8+
var GetRandom = require('../../utils/array/GetRandom');
99

1010
/**
1111
* Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the
@@ -44,7 +44,7 @@ var Randomize = function (tileX, tileY, width, height, indexes, layer)
4444

4545
for (i = 0; i < tiles.length; i++)
4646
{
47-
tiles[i].index = GetRandomElement(indexes);
47+
tiles[i].index = GetRandom(indexes);
4848
}
4949
};
5050

0 commit comments

Comments
 (0)