What is the main difference between world and game?

#1

i have been confusing whether the game is inside the world or world is inside the game.?

#2

Hello @nagFlapjacks, as far as i remember, world is just a group object inside game itself.

If you check this repo which is phaser-ce, and inside here under core/Game.js, there you can see this first:

    /**
    * @property {Phaser.World} world - Reference to the world.
    */
    this.world = null;

After this when you check the boot method of this Game, you can see this line

this.world = new Phaser.World(this);

And so far you can always check the source code when you can’t figure something out :slight_smile:

Another thing that you can also check what is this Phaser.World is, where you will see:

    Phaser.World = function (game)
    {

        Phaser.Group.call(this, game, null, '__world', false);
        ...

When we create the Phaser.World it has just a reference to the game itself

#3

hello @hcakar, thanks for that, one small query do we add physics, camera, etc stuff to the world or game.?

#4

Hey @nagFlapjacks, same thing again you could check the source code but here it is: