Jump to content

Can't resume a scene from another scene


andrsrz
 Share

Recommended Posts

Hi everyone.

I'm trying to implement a pause option in my game. I have two scenes, the scene where the game is being played and the scene when it's telling you that the game is paused.

From the playGame scene I have this code to move to the paused scene

goToPaused(){
    this.scene.pause();
    this.scene.start('paused');
}

This works as intended. The playGame scene is paused and it starts the paused scene. Now, from my paused scene I have this code to resume the playGame scene and stop the paused scene.

resumeGame(){
    this.scene.stop();
    this.scene.resume('playGame');
}

However this gets me the following error:

Uncaught TypeError: can't access property "cut", s is null

I don't know whats happening. Any ideas?

Here is my project: Spaceship Shooter

Edited by andrsrz
Typo
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...