Search the Community

Showing results for tags 'config'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 3 results

  1. Settings (game.cofig)

    Hello, What are all the config keys for game.config, so I need to know How can I move engine folder to a general directory to be re-used for all games and in every game develop the modules tha I need. I mean I, I would like get this structure: . ├── README.md ├── assets │ ├── Audios │ └── Images ├── common │ └── pandajs │ └── engine └── src └── demo ├── game │ ├── background.js │ ├── board.js │ ├── box.js │ ├── frog.js │ ├── index.js │ ├── interactiveimage.js │ ├── mainText.js │ ├── step1.js │ ├── step2.js │ ├── step3.js │ └── utils.js ├── index.html └── settings.js
  2. Can somebody who is already using the TernJS plugin for vim help me configure the .tern-project file for a phaser project. I have generatated the files using yeoman phaser-official generator so my folder structure looks like this: src/ | assets/ | bower_components/ | | phaser-official/ | css/ | js/ | | boot.js | | game.js | | main.js | | main.js.bkup | | menu.js | | preloader.js | index.html Do I have to use RequireJS to configure Tern? If yes, is there any generator that does it automaticaly? I've never used RequireJS before so I don't know how to set my project up with it.
  3. p2 physics config issue

    Before creating an issue on github, decided to put it here (as suggested here https://github.com/photonstorm/phaser/blob/master/CONTRIBUTING.md) Class: Phaser.Physics.P2 Method: constructor Issue: physics config's user-defined options (mpx, mpxi, pxm, pxmi) get deleted in Phaser.Physics.P2 constructor. Proof: Why: game class instance passes the physics config to Phaser.Physics instance, then the config gets passed to Phaser.Physics.P2. Within this chain no other props are created, as a result 'broadphase' prop is never present in the physics config and always created by the p2 class. So, when a new p2 instace is created, the config with your custom mpx, mpxi, pxm, pxmi props gets replaced with a new config of { gravity, broadphase } only. As a result p2 uses default mpx, mpxi, pxm, pxmi methods (so they don't get overriden) How-to-fix: switch from config replacement to property adding. Current code: Phaser.Physics.P2 = function (game, config) {/** * @property {Phaser.Game} game - Local reference to game. */this.game = game;// @note// what if i already defined 'gravity' and 'broadphase' is not defined (btw it's never defined until this point)// my gravity prop will be also overridenif (typeof config === 'undefined' || !config.hasOwnProperty('gravity') || !config.hasOwnProperty('broadphase')){ config = { gravity: [0, 0], broadphase: new p2.SAPBroadphase() };}The fix: Phaser.Physics.P2 = function (game, config) {/** * @property {Phaser.Game} game - Local reference to game. */this.game = game;// config exists? if not - create oneif (typeof config === 'undefined'){ config = {};}// we got gravity? if not - define [0,0]if (!config.hasOwnProperty('gravity')){ config.gravity = [0, 0];}// we got broadphase? if not - create a new instanceif (!config.hasOwnProperty('broadphase')){ config.broadphase = new p2.SAPBroadphase();}// ... now mpx, mpxi, pxm, pxmi props will override the default methods properly// Pixel to meter function overridesif (config.hasOwnProperty('mpx') && config.hasOwnProperty('pxm') && config.hasOwnProperty('mpxi') && config.hasOwnProperty('pxmi')){ this.mpx = config.mpx; this.mpxi = config.mpxi; this.pxm = config.pxm; this.pxmi = config.pxmi;}