Jump to content

Search the Community

Showing results for tags 'overriding'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. 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); //}
×
×
  • Create New...