Two new particle examples and a group animation example. Also fixed CocoonJS sound issue and Cache sound locked bug.

This commit is contained in:
photonstorm
2013-12-31 03:37:11 +00:00
parent 3b87ce9fc9
commit 86f6ddcbc8
15 changed files with 228 additions and 13 deletions
+4 -4
View File
@@ -223,7 +223,7 @@ Phaser.Group.prototype = {
*/
create: function (x, y, key, frame, exists) {
if (typeof exists == 'undefined') { exists = true; }
if (typeof exists === 'undefined') { exists = true; }
var child = new Phaser.Sprite(this.game, x, y, key, frame);
@@ -263,7 +263,7 @@ Phaser.Group.prototype = {
*/
createMultiple: function (quantity, key, frame, exists) {
if (typeof exists == 'undefined') { exists = false; }
if (typeof exists === 'undefined') { exists = false; }
for (var i = 0; i < quantity; i++)
{
@@ -805,7 +805,7 @@ Phaser.Group.prototype = {
},
/**
* Calls a function on all of the children that have exists=true in this Group.
* Returns a reference to a function that exists on a child of the Group based on the given callback array.
*
* @method Phaser.Group#callbackFromArray
* @param {object} child - The object to inspect.
@@ -863,7 +863,7 @@ Phaser.Group.prototype = {
*
* @method Phaser.Group#callAll
* @param {string} method - A string containing the name of the function that will be called. The function must exist on the child.
* @param {string} [context=''] - A string containing the context under which the method will be executed. Leave to '' to default to the child.
* @param {string} [context=null] - A string containing the context under which the method will be executed. Set to null to default to the child.
* @param {...*} parameter - Additional parameters that will be passed to the method.
*/
callAll: function (method, context) {
+1 -1
View File
@@ -320,7 +320,7 @@ Phaser.Cache.prototype = {
decoded = true;
}
this._sounds[key] = { url: url, data: data, isDecoding: false, decoded: decoded, webAudio: webAudio, audioTag: audioTag };
this._sounds[key] = { url: url, data: data, isDecoding: false, decoded: decoded, webAudio: webAudio, audioTag: audioTag, locked: this.game.sound.touchLocked };
},
+1 -1
View File
@@ -552,7 +552,7 @@ Phaser.Sound.prototype = {
else
{
// console.log('sound not locked, state?', this._sound.readyState);
if (this._sound && this._sound.readyState == 4)
if (this._sound && (this.game.device.cocoonJS || this._sound.readyState === 4))
{
this._sound.play();
// This doesn't become available until you call play(), wonderful ...