mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Correct source
checks in setEmitZone
This commit is contained in:
parent
9a974514ff
commit
84ba1ba191
1 changed files with 13 additions and 12 deletions
|
@ -1571,29 +1571,30 @@ var ParticleEmitter = new Class({
|
||||||
var type = GetFastValue(zoneConfig, 'type', 'random');
|
var type = GetFastValue(zoneConfig, 'type', 'random');
|
||||||
var source = GetFastValue(zoneConfig, 'source', null);
|
var source = GetFastValue(zoneConfig, 'source', null);
|
||||||
|
|
||||||
// TODO:
|
if (source)
|
||||||
// For an EdgeZone, only source.getPoints(quantity, stepRate) is required.
|
|
||||||
// For a RandomZone, only source.getRandomPoint(point) is required.
|
|
||||||
// Any object implementing getPoint(position) could also be assigned here (instead of new EdgeZone, new RandomZone).
|
|
||||||
|
|
||||||
if (source && typeof source.getPoint === 'function')
|
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 'random':
|
case 'random':
|
||||||
|
|
||||||
this.emitZone = new RandomZone(source);
|
if (typeof source.getRandomPoint === 'function')
|
||||||
|
{
|
||||||
|
this.emitZone = new RandomZone(source);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edge':
|
case 'edge':
|
||||||
|
|
||||||
var quantity = GetFastValue(zoneConfig, 'quantity', 1);
|
if (typeof source.getPoints === 'function')
|
||||||
var stepRate = GetFastValue(zoneConfig, 'stepRate', 0);
|
{
|
||||||
var yoyo = GetFastValue(zoneConfig, 'yoyo', false);
|
var quantity = GetFastValue(zoneConfig, 'quantity', 1);
|
||||||
var seamless = GetFastValue(zoneConfig, 'seamless', true);
|
var stepRate = GetFastValue(zoneConfig, 'stepRate', 0);
|
||||||
|
var yoyo = GetFastValue(zoneConfig, 'yoyo', false);
|
||||||
|
var seamless = GetFastValue(zoneConfig, 'seamless', true);
|
||||||
|
|
||||||
this.emitZone = new EdgeZone(source, quantity, stepRate, yoyo, seamless);
|
this.emitZone = new EdgeZone(source, quantity, stepRate, yoyo, seamless);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue