Fixed a fantastic FrameData bug. Also added support to the Emitter to handle multiple image keys and/or frames.

This commit is contained in:
Richard Davey
2013-09-10 11:09:25 +01:00
parent 5d3fe891cd
commit 4f950ae801
10 changed files with 703 additions and 281 deletions
+6
View File
@@ -91,4 +91,10 @@ Phaser.GameObjectFactory.prototype = {
},
emitter: function (x, y, maxParticles) {
return this.game.particles.add(new Phaser.Particles.Arcade.Emitter(this.game, x, y, maxParticles));
},
};
+4 -7
View File
@@ -23,16 +23,13 @@ Phaser.Sprite = function (game, x, y, key, frame) {
// The lifespan is decremented by game.time.elapsed each update, once it reaches zero the kill() function is called.
this.lifespan = 0;
if (key)
if (key == null || this.game.cache.checkImageKey(key) == false)
{
PIXI.Sprite.call(this, PIXI.TextureCache[key]);
}
else
{
// No texture yet
PIXI.Sprite.call(this);
key = '__default';
}
PIXI.Sprite.call(this, PIXI.TextureCache[key]);
this.events = new Phaser.Events(this);
/**