Phaser.Group = function (game, parent, name, addToStage, enableBody, physicsBodyType){ if (addToStage === undefined) { addToStage = false ; } if (enableBody === undefined) { enableBody = false ; } if (physicsBodyType === undefined) { physicsBodyType = Phaser.Physics.ARCADE; } this.game = game; if (parent === undefined) { parent = game.world; } this.name = name || 'group'; this.z = 0; PIXI.DisplayObjectContainer.call(this); if (addToStage) { this.game.stage.addChild(this); this.z = _AN_Read_length('length', this.game.stage.children); } else { if (parent) { parent.addChild(this); this.z = _AN_Read_length('length', parent.children); } } this.type = Phaser.GROUP; this.physicsType = Phaser.GROUP; this.alive = true ; this.exists = true ; this.ignoreDestroy = false ; this.pendingDestroy = false ; this.classType = Phaser.Sprite; _AN_Write_cursor('cursor', this, false , null ); this.enableBody = enableBody; this.enableBodyDebug = false ; this.physicsBodyType = physicsBodyType; this.physicsSortDirection = null ; this.onDestroy = new Phaser.Signal(); this.cursorIndex = 0; this.fixedToCamera = false ; this.cameraOffset = new Phaser.Point(); _AN_Write_hash('hash', this, false , [] ); this._sortProperty = 'z'; } ; Phaser.Group.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); Phaser.Group.prototype.constructor = Phaser.Group; Phaser.Group.RETURN_NONE = 0; Phaser.Group.RETURN_TOTAL = 1; Phaser.Group.RETURN_CHILD = 2; Phaser.Group.SORT_ASCENDING = -1; Phaser.Group.SORT_DESCENDING = 1; Phaser.Group.prototype.add = function (child, silent){ if (silent === undefined) { silent = false ; } if (child.parent !== this) { this.addChild(child); child.z = _AN_Read_length('length', this.children); if (this.enableBody && child.body === null ) { this.game.physics.enable(child, this.physicsBodyType); } else if (child.body) { this.addToHash(child); } if (!silent && child.events) { child.events.onAddedToGroup$dispatch(child, this); } if (this.cursor === null ) { _AN_Write_cursor('cursor', this, false , child); } } return child; } ; Phaser.Group.prototype.addToHash = function (child){ if (child.parent === this) { var index = _AN_Read_hash('hash', this).indexOf(child); if (index === -1) { _AN_Read_hash('hash', this).push(child); return true ; } } return false ; } ; Phaser.Group.prototype.removeFromHash = function (child){ if (child) { var index = _AN_Read_hash('hash', this).indexOf(child); if (index !== -1) { _AN_Read_hash('hash', this).splice(index, 1); return true ; } } return false ; } ; Phaser.Group.prototype.addMultiple = function (children, silent){ if (children instanceof Phaser.Group) { children.moveAll(this, silent); } else if (Array.isArray(children)) { for (var i = 0; i < _AN_Read_length('length', children); i++ ){ this.add(children[i], silent); } } return children; } ; Phaser.Group.prototype.addAt = function (child, index, silent){ if (silent === undefined) { silent = false ; } if (child.parent !== this) { this.addChildAt(child, index); this.updateZ(); if (this.enableBody && child.body === null ) { this.game.physics.enable(child, this.physicsBodyType); } else if (child.body) { this.addToHash(child); } if (!silent && child.events) { child.events.onAddedToGroup$dispatch(child, this); } if (this.cursor === null ) { _AN_Write_cursor('cursor', this, false , child); } } return child; } ; Phaser.Group.prototype.getAt = function (index){ if (index < 0 || index >= _AN_Read_length('length', this.children)) { return -1; } else { return this.getChildAt(index); } } ; Phaser.Group.prototype.create = function (x, y, key, frame, exists){ if (exists === undefined) { exists = true ; } var child = new this.classType(this.game, x, y, key, frame); child.exists = exists; child.visible = exists; child.alive = exists; this.addChild(child); child.z = _AN_Read_length('length', this.children); if (this.enableBody) { this.game.physics.enable(child, this.physicsBodyType, this.enableBodyDebug); } if (child.events) { child.events.onAddedToGroup$dispatch(child, this); } if (this.cursor === null ) { _AN_Write_cursor('cursor', this, false , child); } return child; } ; Phaser.Group.prototype.createMultiple = function (quantity, key, frame, exists){ if (exists === undefined) { exists = false ; } for (var i = 0; i < quantity; i++ ){ this.create(0, 0, key, frame, exists); } } ; Phaser.Group.prototype.updateZ = function (){ var i = _AN_Read_length('length', this.children); while (i-- ){ this.children[i].z = i; } } ; Phaser.Group.prototype.resetCursor = function (index){ if (index === undefined) { index = 0; } if (index > _AN_Read_length('length', this.children) - 1) { index = 0; } if (this.cursor) { this.cursorIndex = index; _AN_Write_cursor('cursor', this, false , this.children[this.cursorIndex]); return this.cursor; } } ; Phaser.Group.prototype.next = function (){ if (this.cursor) { if (this.cursorIndex >= _AN_Read_length('length', this.children) - 1) { this.cursorIndex = 0; } else { this.cursorIndex++ ; } _AN_Write_cursor('cursor', this, false , this.children[this.cursorIndex]); return this.cursor; } } ; Phaser.Group.prototype.previous = function (){ if (this.cursor) { if (this.cursorIndex === 0) { this.cursorIndex = _AN_Read_length('length', this.children) - 1; } else { this.cursorIndex-- ; } _AN_Write_cursor('cursor', this, false , this.children[this.cursorIndex]); return this.cursor; } } ; Phaser.Group.prototype.swap = function (child1, child2){ this.swapChildren(child1, child2); this.updateZ(); } ; Phaser.Group.prototype.bringToTop = function (child){ if (child.parent === this && this.getIndex(child) < _AN_Read_length('length', this.children)) { this.remove(child, false , true ); this.add(child, true ); } return child; } ; Phaser.Group.prototype.sendToBack = function (child){ if (child.parent === this && this.getIndex(child) > 0) { this.remove(child, false , true ); this.addAt(child, 0, true ); } return child; } ; Phaser.Group.prototype.moveUp = function (child){ if (child.parent === this && this.getIndex(child) < _AN_Read_length('length', this.children) - 1) { var a = this.getIndex(child); var b = this.getAt(a + 1); if (b) { this.swap(child, b); } } return child; } ; Phaser.Group.prototype.moveDown = function (child){ if (child.parent === this && this.getIndex(child) > 0) { var a = this.getIndex(child); var b = this.getAt(a - 1); if (b) { this.swap(child, b); } } return child; } ; Phaser.Group.prototype.xy = function (index, x, y){ if (index < 0 || index > _AN_Read_length('length', this.children)) { return -1; } else { this.getChildAt(index).x = x; this.getChildAt(index).y = y; } } ; Phaser.Group.prototype.reverse = function (){ this.children.reverse(); this.updateZ(); } ; Phaser.Group.prototype.getIndex = function (child){ return this.children.indexOf(child); } ; Phaser.Group.prototype.replace = function (oldChild, newChild){ var index = this.getIndex(oldChild); if (index !== -1) { if (newChild.parent) { if (newChild.parent instanceof Phaser.Group) { newChild.parent.remove(newChild); } else { newChild.parent.removeChild(newChild); } } this.remove(oldChild); this.addAt(newChild, index); return oldChild; } } ; Phaser.Group.prototype.hasProperty = function (child, key){ var len = _AN_Read_length('length', key); if (len === 1 && key[0] in child) { return true ; } else if (len === 2 && key[0] in child && key[1] in child[key[0]]) { return true ; } else if (len === 3 && key[0] in child && key[1] in child[key[0]] && key[2] in child[key[0]][key[1]]) { return true ; } else if (len === 4 && key[0] in child && key[1] in child[key[0]] && key[2] in child[key[0]][key[1]] && key[3] in child[key[0]][key[1]][key[2]]) { return true ; } return false ; } ; Phaser.Group.prototype.setProperty = function (child, key, value, operation, force){ if (force === undefined) { force = false ; } operation = operation || 0; if (!this.hasProperty(child, key) && (!force || operation > 0)) { return false ; } var len = _AN_Read_length('length', key); if (len === 1) { if (operation === 0) { child[key[0]] = value; } else if (operation == 1) { child[key[0]] += value; } else if (operation == 2) { child[key[0]] -= value; } else if (operation == 3) { child[key[0]] *= value; } else if (operation == 4) { child[key[0]] /= value; } } else if (len === 2) { if (operation === 0) { child[key[0]][key[1]] = value; } else if (operation == 1) { child[key[0]][key[1]] += value; } else if (operation == 2) { child[key[0]][key[1]] -= value; } else if (operation == 3) { child[key[0]][key[1]] *= value; } else if (operation == 4) { child[key[0]][key[1]] /= value; } } else if (len === 3) { if (operation === 0) { child[key[0]][key[1]][key[2]] = value; } else if (operation == 1) { child[key[0]][key[1]][key[2]] += value; } else if (operation == 2) { child[key[0]][key[1]][key[2]] -= value; } else if (operation == 3) { child[key[0]][key[1]][key[2]] *= value; } else if (operation == 4) { child[key[0]][key[1]][key[2]] /= value; } } else if (len === 4) { if (operation === 0) { child[key[0]][key[1]][key[2]][key[3]] = value; } else if (operation == 1) { child[key[0]][key[1]][key[2]][key[3]] += value; } else if (operation == 2) { child[key[0]][key[1]][key[2]][key[3]] -= value; } else if (operation == 3) { child[key[0]][key[1]][key[2]][key[3]] *= value; } else if (operation == 4) { child[key[0]][key[1]][key[2]][key[3]] /= value; } } return true ; } ; Phaser.Group.prototype.checkProperty = function (child, key, value, force){ if (force === undefined) { force = false ; } if (!Phaser.Utils.getProperty(child, key) && force) { return false ; } if (Phaser.Utils.getProperty(child, key) !== value) { return false ; } return true ; } ; Phaser.Group.prototype.set = function (child, key, value, checkAlive, checkVisible, operation, force){ if (force === undefined) { force = false ; } key = key.split('.'); if (checkAlive === undefined) { checkAlive = false ; } if (checkVisible === undefined) { checkVisible = false ; } if ((checkAlive === false || (checkAlive && child.alive)) && (checkVisible === false || (checkVisible && child.visible))) { return this.setProperty(child, key, value, operation, force); } } ; Phaser.Group.prototype.setAll = function (key, value, checkAlive, checkVisible, operation, force){ if (checkAlive === undefined) { checkAlive = false ; } if (checkVisible === undefined) { checkVisible = false ; } if (force === undefined) { force = false ; } key = key.split('.'); operation = operation || 0; for (var i = 0; i < _AN_Read_length('length', this.children); i++ ){ if ((!checkAlive || (checkAlive && this.children[i].alive)) && (!checkVisible || (checkVisible && this.children[i].visible))) { this.setProperty(this.children[i], key, value, operation, force); } } } ; Phaser.Group.prototype.setAllChildren = function (key, value, checkAlive, checkVisible, operation, force){ if (checkAlive === undefined) { checkAlive = false ; } if (checkVisible === undefined) { checkVisible = false ; } if (force === undefined) { force = false ; } operation = operation || 0; for (var i = 0; i < _AN_Read_length('length', this.children); i++ ){ if ((!checkAlive || (checkAlive && this.children[i].alive)) && (!checkVisible || (checkVisible && this.children[i].visible))) { if (this.children[i] instanceof Phaser.Group) { this.children[i].setAllChildren(key, value, checkAlive, checkVisible, operation, force); } else { this.setProperty(this.children[i], key.split('.'), value, operation, force); } } } } ; Phaser.Group.prototype.checkAll = function (key, value, checkAlive, checkVisible, force){ if (checkAlive === undefined) { checkAlive = false ; } if (checkVisible === undefined) { checkVisible = false ; } if (force === undefined) { force = false ; } for (var i = 0; i < _AN_Read_length('length', this.children); i++ ){ if ((!checkAlive || (checkAlive && this.children[i].alive)) && (!checkVisible || (checkVisible && this.children[i].visible))) { if (!this.checkProperty(this.children[i], key, value, force)) { return false ; } } } return true ; } ; Phaser.Group.prototype.addAll = function (property, amount, checkAlive, checkVisible){ this.setAll(property, amount, checkAlive, checkVisible, 1); } ; Phaser.Group.prototype.subAll = function (property, amount, checkAlive, checkVisible){ this.setAll(property, amount, checkAlive, checkVisible, 2); } ; Phaser.Group.prototype.multiplyAll = function (property, amount, checkAlive, checkVisible){ this.setAll(property, amount, checkAlive, checkVisible, 3); } ; Phaser.Group.prototype.divideAll = function (property, amount, checkAlive, checkVisible){ this.setAll(property, amount, checkAlive, checkVisible, 4); } ; Phaser.Group.prototype.callAllExists = function (callback, existsValue){ var args; if (_AN_Read_length('length', arguments) > 2) { args = [] ; for (var i = 2; i < _AN_Read_length('length', arguments); i++ ){ args.push(arguments[i]); } } for (var i = 0; i < _AN_Read_length('length', this.children); i++ ){ if (this.children[i].exists === existsValue && this.children[i][callback]) { this.children[i][callback].apply(this.children[i], args); } } } ; Phaser.Group.prototype.callbackFromArray = function (child, callback, length){ if (length == 1) { if (child[callback[0]]) { return child[callback[0]]; } } else if (length == 2) { if (child[callback[0]][callback[1]]) { return child[callback[0]][callback[1]]; } } else if (length == 3) { if (child[callback[0]][callback[1]][callback[2]]) { return child[callback[0]][callback[1]][callback[2]]; } } else if (length == 4) { if (child[callback[0]][callback[1]][callback[2]][callback[3]]) { return child[callback[0]][callback[1]][callback[2]][callback[3]]; } } else { if (child[callback]) { return child[callback]; } } return false ; } ; Phaser.Group.prototype.callAll = function (method, context){ if (method === undefined) { return ; } method = method.split('.'); var methodLength = _AN_Read_length('length', method); if (context === undefined || context === null || context === '') { context = null ; } else { if (typeof context === 'string') { context = context.split('.'); var contextLength = _AN_Read_length('length', context); } } var args; if (_AN_Read_length('length', arguments) > 2) { args = [] ; for (var i = 2; i < _AN_Read_length('length', arguments); i++ ){ args.push(arguments[i]); } } var callback = null ; var callbackContext = null ; for (var i = 0; i < _AN_Read_length('length', this.children); i++ ){ callback = this.callbackFromArray(this.children[i], method, methodLength); if (context && callback) { callbackContext = this.callbackFromArray(this.children[i], context, contextLength); if (callback) { callback.apply(callbackContext, args); } } else if (callback) { callback.apply(this.children[i], args); } } } ; Phaser.Group.prototype.preUpdate = function (){ if (this.pendingDestroy) { this.destroy(); return false ; } if (!this.exists || !this.parent.exists) { this.renderOrderID = -1; return false ; } var i = _AN_Read_length('length', this.children); while (i-- ){ this.children[i].preUpdate(); } return true ; } ; Phaser.Group.prototype.update = function (){ var i = _AN_Read_length('length', this.children); while (i-- ){ this.children[i].update(); } } ; Phaser.Group.prototype.postUpdate = function (){ if (this.fixedToCamera) { this.x = this.game.camera.view.x + this.cameraOffset.x; this.y = this.game.camera.view.y + this.cameraOffset.y; } var i = _AN_Read_length('length', this.children); while (i-- ){ this.children[i].postUpdate(); } } ; Phaser.Group.prototype.filter = function (predicate, checkExists){ var index = -1; var length = _AN_Read_length('length', this.children); var results = [] ; while (++index < length){ var child = this.children[index]; if (!checkExists || (checkExists && child.exists)) { if (predicate(child, index, this.children)) { results.push(child); } } } return new Phaser.ArraySet(results); } ; Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExists){ if (checkExists === undefined) { checkExists = false ; } if (_AN_Read_length('length', arguments) <= 3) { for (var i = 0; i < _AN_Read_length('length', this.children); i++ ){ if (!checkExists || (checkExists && this.children[i].exists)) { callback.call(callbackContext, this.children[i]); } } } else { var args = [null ] ; for (var i = 3; i < _AN_Read_length('length', arguments); i++ ){ args.push(arguments[i]); } for (var i = 0; i < _AN_Read_length('length', this.children); i++ ){ if (!checkExists || (checkExists && this.children[i].exists)) { args[0] = this.children[i]; callback.apply(callbackContext, args); } } } } ; Phaser.Group.prototype.forEachExists = function (callback, callbackContext){ var args; if (_AN_Read_length('length', arguments) > 2) { args = [null ] ; for (var i = 2; i < _AN_Read_length('length', arguments); i++ ){ args.push(arguments[i]); } } this.iterate('exists', true , Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); } ; Phaser.Group.prototype.forEachAlive = function (callback, callbackContext){ var args; if (_AN_Read_length('length', arguments) > 2) { args = [null ] ; for (var i = 2; i < _AN_Read_length('length', arguments); i++ ){ args.push(arguments[i]); } } this.iterate('alive', true , Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); } ; Phaser.Group.prototype.forEachDead = function (callback, callbackContext){ var args; if (_AN_Read_length('length', arguments) > 2) { args = [null ] ; for (var i = 2; i < _AN_Read_length('length', arguments); i++ ){ args.push(arguments[i]); } } this.iterate('alive', false , Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); } ; Phaser.Group.prototype.sort = function (key, order){ if (_AN_Read_length('length', this.children) < 2) { return ; } if (key === undefined) { key = 'z'; } if (order === undefined) { order = Phaser.Group.SORT_ASCENDING; } this._sortProperty = key; if (order === Phaser.Group.SORT_ASCENDING) { this.children.sort(this.ascendingSortHandler.bind(this)); } else { this.children.sort(this.descendingSortHandler.bind(this)); } this.updateZ(); } ; Phaser.Group.prototype.customSort = function (sortHandler, context){ if (_AN_Read_length('length', this.children) < 2) { return ; } this.children.sort(sortHandler.bind(context)); this.updateZ(); } ; Phaser.Group.prototype.ascendingSortHandler = function (a, b){ if (a[this._sortProperty] < b[this._sortProperty]) { return -1; } else if (a[this._sortProperty] > b[this._sortProperty]) { return 1; } else { if (a.z < b.z) { return -1; } else { return 1; } } } ; Phaser.Group.prototype.descendingSortHandler = function (a, b){ if (a[this._sortProperty] < b[this._sortProperty]) { return 1; } else if (a[this._sortProperty] > b[this._sortProperty]) { return -1; } else { return 0; } } ; Phaser.Group.prototype.iterate = function (key, value, returnType, callback, callbackContext, args){ if (returnType === Phaser.Group.RETURN_TOTAL && _AN_Read_length('length', this.children) === 0) { return 0; } var total = 0; for (var i = 0; i < _AN_Read_length('length', this.children); i++ ){ if (this.children[i][key] === value) { total++ ; if (callback) { if (args) { args[0] = this.children[i]; callback.apply(callbackContext, args); } else { callback.call(callbackContext, this.children[i]); } } if (returnType === Phaser.Group.RETURN_CHILD) { return this.children[i]; } } } if (returnType === Phaser.Group.RETURN_TOTAL) { return total; } return null ; } ; Phaser.Group.prototype.getFirstExists = function (exists, createIfNull, x, y, key, frame){ if (createIfNull === undefined) { createIfNull = false ; } if (typeof exists !== 'boolean') { exists = true ; } var child = this.iterate('exists', exists, Phaser.Group.RETURN_CHILD); return (child === null && createIfNull)? this.create(x, y, key, frame): this.resetChild(child, x, y, key, frame); } ; Phaser.Group.prototype.getFirstAlive = function (createIfNull, x, y, key, frame){ if (createIfNull === undefined) { createIfNull = false ; } var child = this.iterate('alive', true , Phaser.Group.RETURN_CHILD); return (child === null && createIfNull)? this.create(x, y, key, frame): this.resetChild(child, x, y, key, frame); } ; Phaser.Group.prototype.getFirstDead = function (createIfNull, x, y, key, frame){ if (createIfNull === undefined) { createIfNull = false ; } var child = this.iterate('alive', false , Phaser.Group.RETURN_CHILD); return (child === null && createIfNull)? this.create(x, y, key, frame): this.resetChild(child, x, y, key, frame); } ; Phaser.Group.prototype.resetChild = function (child, x, y, key, frame){ if (child === null ) { return null ; } if (x === undefined) { x = null ; } if (y === undefined) { y = null ; } if (x !== null && y !== null ) { child.reset(x, y); } if (key !== undefined) { child.loadTexture(key, frame); } return child; } ; Phaser.Group.prototype.getTop = function (){ if (_AN_Read_length('length', this.children) > 0) { return this.children[_AN_Read_length('length', this.children) - 1]; } } ; Phaser.Group.prototype.getBottom = function (){ if (_AN_Read_length('length', this.children) > 0) { return this.children[0]; } } ; Phaser.Group.prototype.countLiving = function (){ return this.iterate('alive', true , Phaser.Group.RETURN_TOTAL); } ; Phaser.Group.prototype.countDead = function (){ return this.iterate('alive', false , Phaser.Group.RETURN_TOTAL); } ; Phaser.Group.prototype.getRandom = function (startIndex, length){ if (_AN_Read_length('length', this.children) === 0) { return null ; } startIndex = startIndex || 0; length = length || _AN_Read_length('length', this.children); return Phaser.ArrayUtils.getRandomItem(this.children, startIndex, length); } ; Phaser.Group.prototype.remove = function (child, destroy, silent){ if (destroy === undefined) { destroy = false ; } if (silent === undefined) { silent = false ; } if (_AN_Read_length('length', this.children) === 0 || this.children.indexOf(child) === -1) { return false ; } if (!silent && child.events && !child.destroyPhase) { child.events.onRemovedFromGroup$dispatch(child, this); } var removed = this.removeChild(child); this.removeFromHash(child); this.updateZ(); if (this.cursor === child) { this.next(); } if (destroy && removed) { removed.destroy(true ); } return true ; } ; Phaser.Group.prototype.moveAll = function (group, silent){ if (silent === undefined) { silent = false ; } if (_AN_Read_length('length', this.children) > 0 && group instanceof Phaser.Group) { do { group.add(this.children[0], silent); } while(_AN_Read_length('length', this.children) > 0)_AN_Write_hash('hash', this, false , [] ); _AN_Write_cursor('cursor', this, false , null ); } return group; } ; Phaser.Group.prototype.removeAll = function (destroy, silent){ if (destroy === undefined) { destroy = false ; } if (silent === undefined) { silent = false ; } if (_AN_Read_length('length', this.children) === 0) { return ; } do { if (!silent && this.children[0].events) { this.children[0].events.onRemovedFromGroup$dispatch(this.children[0], this); } var removed = this.removeChild(this.children[0]); this.removeFromHash(removed); if (destroy && removed) { removed.destroy(true ); } } while(_AN_Read_length('length', this.children) > 0)_AN_Write_hash('hash', this, false , [] ); _AN_Write_cursor('cursor', this, false , null ); } ; Phaser.Group.prototype.removeBetween = function (startIndex, endIndex, destroy, silent){ if (endIndex === undefined) { endIndex = _AN_Read_length('length', this.children) - 1; } if (destroy === undefined) { destroy = false ; } if (silent === undefined) { silent = false ; } if (_AN_Read_length('length', this.children) === 0) { return ; } if (startIndex > endIndex || startIndex < 0 || endIndex > _AN_Read_length('length', this.children)) { return false ; } var i = endIndex; while (i >= startIndex){ if (!silent && this.children[i].events) { this.children[i].events.onRemovedFromGroup$dispatch(this.children[i], this); } var removed = this.removeChild(this.children[i]); this.removeFromHash(removed); if (destroy && removed) { removed.destroy(true ); } if (this.cursor === this.children[i]) { _AN_Write_cursor('cursor', this, false , null ); } i-- ; } this.updateZ(); } ; Phaser.Group.prototype.destroy = function (destroyChildren, soft){ if (this.game === null || this.ignoreDestroy) { return ; } if (destroyChildren === undefined) { destroyChildren = true ; } if (soft === undefined) { soft = false ; } this.onDestroy.dispatch(this, destroyChildren, soft); this.removeAll(destroyChildren); _AN_Write_cursor('cursor', this, false , null ); this.filters = null ; this.pendingDestroy = false ; if (!soft) { if (this.parent) { this.parent.removeChild(this); } this.game = null ; this.exists = false ; } } ; Object.defineProperty(Phaser.Group.prototype, "total", { get: function (){ return this.iterate('exists', true , Phaser.Group.RETURN_TOTAL); } } ); Object.defineProperty(Phaser.Group.prototype, "length", { get: function (){ return _AN_Read_length("length", this.children); } } ); Object.defineProperty(Phaser.Group.prototype, "angle", { get: function (){ return Phaser.Math.radToDeg(this.rotation); } , set: function (value){ this.rotation = Phaser.Math.degToRad(value); } } );