Search the Community
Showing results for tags 'phaser.group'.
-
Can the 'create' function in Phaser.Group be successfully over-ridden? Is there an alternative? I am looking for a way to have a function called at the start of my object's life-cycle and still be able to access the functions I have built into the class. I am used to Unity3D where there is always an option to do this. There is certain code that I need to execute at the start of my object's life-cycle, and additionally whenever the level ID is set in my function. Am I being clear, or have I worded this too confusingly? Thanks much! FriarDude.FallingShitFactory = function (game) { // Class variables this.levelID = 0; this.active = false; this.spawnTimer = null; this.percentShitQuantities = new Array(); this.HORIZONTAL_MARGIN = 64; // // The constructor can take an optional parameter (levelID, 0 by default) if (arguments.length == 2) { this.levelID = arguments[1]; } // // Constructor Phaser.Group.call(this, game); game.time.events.loop(1000, this.spawnShit, this); console.log('construct'); return this; //};FriarDude.FallingShitFactory.prototype = Object.create(Phaser.Group.prototype);FriarDude.FallingShitFactory.prototype.constructor = FriarDude.FallingShitFactory;FriarDude.FallingShitFactory.prototype.create = function() { // Load Level Data console.log('create'); this.setLevelID(this.levelID); //}
- 3 replies
-
- group
- phaser.group
-
(and 3 more)
Tagged with:
-
hi all I have some item in some group. How can i find parent group of my item and index of item in this group?
- 2 replies
-
- phaser.group
- phaser
-
(and 1 more)
Tagged with: