{"size": 1090, "ext": "js", "max_stars_repo_path": "src/Scenes/Menu.js", "max_stars_repo_name": "ahonore42/Pokemon_Dream", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/Scenes/Menu.js", "max_issues_repo_name": "ahonore42/Pokemon_Dream", "max_issues_repo_issues_event_min_datetime": "2021-03-10T13:19:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-19T00:03:24.000Z", "max_forks_repo_path": "src/Scenes/Menu.js", "max_forks_repo_name": "ahonore42/Pokemon_Dream", "max_forks_repo_forks_event_min_datetime": "2020-04-02T22:48:23.000Z", "max_forks_repo_forks_event_max_datetime": "2020-04-10T22:23:57.000Z"}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": 2, "avg_line_length": 27.9487179487, "max_line_length": 133, "alphanum_fraction": 0.5972477064}
import 'phaser';
 
export default class MenuScene extends Phaser.Scene {
  constructor () {
    super('Menu');
  }
 
  preload () {

  }
 
  create () {

    this.add.image(0, -220, 'menuBackground').setOrigin(0).setDepth(0);

    // create title text
    this.titleText = this.add.text(this.scale.width / 2, this.scale.height / 3, '[Pokemon Dream]', {fontSize: '80px', fill: '#007'});
    this.titleText.setOrigin(0.5);
    this.button = this.add.image(this.scale.width / 2, this.scale.height / 1.5, 'button1');
    this.button.setInteractive();
    
    this.buttonText = this.add.text(0,0, 'New Game', {fontSize: '32px', fill:'#000'});
    Phaser.Display.Align.In.Center(this.buttonText, this.button);    
 
    this.button.on('pointerdown', () => {
      this.scene.start('Game');
      this.scene.start('Game', {level: 1, newGame: true, levels: {1: "map1", 2: "map2", 3: "dungeon"}});
    });
 
    this.button.on('pointerover', () => {
      this.button.setTexture('button2');
    });
 
    this.button.on('pointerout', () => {
      this.button.setTexture('button1');
    });
  }

};