# Switching levels?

**URL:** <https://phaser.discourse.group/t/switching-levels/4376>\
**Category:** Phaser 3\
**Created:** [November 26, 2019, 11:19pm UTC](https://phaser.discourse.group/t/switching-levels/4376 "2019-11-26T23:19:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thundros](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/thundros/32/2057_2.png) [@Thundros](https://phaser.discourse.group/u/Thundros)\
**Post date:** [November 26, 2019, 11:19pm UTC](https://phaser.discourse.group/t/switching-levels/4376/1 "2019-11-26T23:19:29Z")

</div>

so i’m trying to switch levels but i have a problem.

when i load the assets like this :

```javascript
// Load Tileset for Level{s} { 1 }

this.load.image ( 'lvl-1', 'assets/tilesets/platformPack_tilesheet.png' );

// Load Tileset for Level{s} { 2 }

this.load.image ( 'lvl-2', 'assets/tilesets/platformPack_tilesheet-2.png' );

// Load Level { 1 }

this.__load.tilemapTiledJSON ( 'lvl-1', 'assets/tilemaps/levels/lvl-1.json' );

// Load Level { 2 }

this.__load.tilemapTiledJSON ( 'lvl-2', 'assets/tilemaps/levels/lvl-2.json' );

```

& use this class :

```javascript
class LevelManager {

    constructor ( __scene ) {

        this. __scene =__ scene;
        this.__level = 0;

        this.__data = [

            { enemies : 10, }, 
            { enemies : 20, }, 

        ];

    }

    nextLevel ( __scene,__ sceneKey ) {

        this.__level++;

        this. __scene =__ scene;
        this. __sceneKey =__ sceneKey;

        this.__scene.scene.start (
            this.__sceneKey, 
            this.__data [this.__level]
        );

        if ( this.__level > 0 ) {
            console.log ( 'SCENE' + ' :: ' + ' { ' + '\'' + ( this.__level + 1 ) + '\'' + ' } ' + 'WITH' + ' ' + 'SCENE KEY' + ' ' + '::' + ' { ' + '\'' + this.__sceneKey + '\'' + ' } ' + 'HAS BEEN STARTED!' );
            console.log ( 'Data :: ' + '\r\n', this.__data [this.__level] );
        }

    }

}

```

& call it like this :

```javascript
this.physics.add.overlap ( this.hero.sprite, this.__goal, function ( objectA, objectB )

{

    if ( ! ( this.__hasOverlapped ) )

    {

        // this.sound.play ( 'detach-camera' );
        // objectB.destroy ( );

        this.__level.nextLevel ( this, 'lvl-2' );

        this.__hasOverlapped = true;

    }

}, null, this );

```

i get a blank scene even though i load my tileset & JSON files for lvl-1 & lvl-2…

i just want it to switch & load my new JSON level.
