Sign in to follow this  


Recommended Posts

Hi all,

I'm wondering where can I find the game-configuration-object's description? I was browsing the docs here and, even if I don't know if it does have what I am looking for, when I clicked in the GameConfig param link, I got an 404 Error. So now I don't know where to look for.

Can you help me understand the game config object?

Share this post

Link to post
Share on other sites

Game Config is pretty need, it really helps you to organize your code.


Back in Phaser 2 when you instantiate Phaser you write something like this:

let game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });

First time I saw this I wasn't sure what are these parameters for. And these are just basic parameters that Phaser constructor can accept...Which is not really good quality good overall.


Now Phaser 3 simplifies this by adding a object, called gameObject. It looks like this:

let GameConfig = {
        type: Phaser.CANVAS,
        width: 800,
        height: 600,
        scene: [Boot, Game],
        backgroundColor: "#dbcf8b",

The order doesn't matter, some parameters are optional so you don't have to write them all. After setting up everything, just pass the object to contructor

let game = new Phaser(GameConfig);

So back to your question. Just make the object yourself.

Share this post

Link to post
Share on other sites

Thanks all for replying.

Yes @michebn what I want i can find it at as you can see there's almost no description there and you have nothing here .

I was looking for something like @samme provide at but Phaser 3 not phaser-ce.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.