Jump to content

Search the Community

Showing results for tags 'object properties'.

  • 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. Hi, I am new to PhaserJS and I have been learning the basics with the Interphase book. I would like to know why is everything defined inside the prototype? Is this for avoiding performance issues? Common practice? Or because I am going in this way you can reuse the State several times in the game? Also, what is the purpose of defining objects properties inside the function and then use them in the prototype? For example, see this.sprite and this.bg in the example below; is this a way of sharing the parameters across states? var MyGame = {};MyGame.StateA = function (game) { this.sprite = null; this.bg = null;};MyGame.StateA.prototype = { preload: function () {}, create: function () {}};
×
×
  • Create New...