Jump to content

Search the Community

Showing results for tags 'config'.

  • 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 6 results

  1. How do you configure the server for this template ? => https://github.com/nkholski/phaser3-es6-webpack I'm trying to do it by following this tutorial => https://gamedevacademy.org/create-a-basic-multiplayer-game-in-phaser-3-with-socket-io-part-1/?a=13 I added two dependencies: nodemon and express. I created the server.js file with the server configuration. const express = require('express') const app = express() const server = require('http').Server(app) const path = require('path') app.get('/', function(req, res) { res.sendFile(path.resolve('index.html')) }) server.listen(8081, function() { console.log(`Listening on ${server.address().port}`) }) In the package.json file, I added a command to start the server: nodemon src/server/server.js The server starts correctly but the indicated html file can not read the scripts (" The load failed for the "script" element with the source vendor.js and app.js"). Project structure:
  2. Does anyone know how to pass data into the game scene in Phaser 3 as you could do in Phaser 2 when started a state? game.state.start('Game', true, true, { data: 'this is some initial config' }); Phaser 3 Scene was Phaser 2 State, which you could provide parameters, the 2-3rd was as i remember caching, the 4th could be and data, which became available in the State's init() {} method as init({data}). In Phaser 3 a Scene has a second, data param, but it is not clear how it is used, the init method is not getting it, and the documentation is not ready for that as far as i know.
  3. Hello, i have this script which is based on the tutorial: i want the player to navigate through the world, but it's constrained to a 800x600 box, (as this is the world WxH), the "game" world is a GIF 4096x3500. maybe this is not the correct way, could you please lead me into the correct way? this is the code: http://cypunkdb.net/t/phaser/tut1b/part7.html thanks
  4. 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
  5. 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.
  6. 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;}
×
×
  • Create New...