text: import Phaser from 'phaser';
  import Button from '../Objects/Button';
  
  export default class OptionsScene extends Phaser.Scene {
    constructor() {
      super('Options');
    }
  
    create() {
      this.model = this.sys.game.globals.model;
  
      this.text = this.add.bitmapText(300, 100, 'arcade', 'Options', 40);
      this.musicButton = this.add.image(200, 200, 'checkedBox');
      this.musicText = this.add.bitmapText(250, 190, 'arcade', 'Music Enabled', 24);
  
      this.soundButton = this.add.image(200, 300, 'checkedBox');
      this.soundText = this.add.bitmapText(250, 290, 'arcade', 'Sound Enabled', 24);
  
      this.musicButton.setInteractive();
      this.soundButton.setInteractive();
  
      this.musicButton.on('pointerdown', () => {
        this.model.musicOn = !this.model.musicOn;
        this.updateAudio();
      });
  
      this.soundButton.on('pointerdown', () => {
        this.model.soundOn = !this.model.soundOn;
        this.updateAudio();
      });
  
      this.menuButton = new Button(this, 400, 500, 'blueButton1', 'blueButton2', 'Menu', 'Title');
  
      this.updateAudio();
    }
  
    updateAudio() {
      if (this.model.musicOn === false) {
        this.musicButton.setTexture('box');
        this.sys.game.globals.bgMusic.stop();
        this.model.bgMusicPlaying = false;
      } else {
        this.musicButton.setTexture('checkedBox');
        if (this.model.bgMusicPlaying === false) {
          this.sys.game.globals.bgMusic.play();
          this.model.bgMusicPlaying = true;
        }
      }
  
      if (this.model.soundOn === false) {
        this.soundButton.setTexture('box');
      } else {
        this.soundButton.setTexture('checkedBox');
      }
    }
  }