Super Keyword Error

While trying to make a multi scene game I was using the “class” to write code for different scenes. Can anyone help me with this error I got for writing this code

class level1 extends Phaser.Scene{
constructor(){
super(“level1”);
}
create(){
this.add.text(400, 300, ‘Start Game!!!’);
}
}

and I got the following error from google

Uncaught SyntaxError: ‘super’ keyword unexpected here

Hi,

You need to add an object with a key parameter such as.

super({key: 'level1'});

Hope this helps :slight_smile:

2 Likes