function Menu() {
  this.drawButton;
}

Menu.prototype = {
  preload: function() {
      
  },
  create: function() {
    
    //mu-sic
    if(FingerPuppets.music) {
      if(FingerPuppets.music.key != "titleMusic") {
        FingerPuppets.music = this.add.audio('titleMusic', 1, true);
        FingerPuppets.music.play();
      }
    } else {
      FingerPuppets.music = this.add.audio('titleMusic', 1, true);
      FingerPuppets.music.play();
    }

    //bg
    this.add.sprite(0,0, 'bg');

    //title!
    this.titleimg = this.add.sprite(TARGET_WIDTH / 2, TARGET_HEIGHT / 2 - 100, 'title');
    this.titleimg.anchor.set(.5, .5);
    this.add.tween(this.titleimg).from({alpha: 0}, 700, Phaser.Easing.Quartic.Out, true);

    //play ... button
    this.playButton = this.add.sprite(TARGET_WIDTH / 2 - 200, TARGET_HEIGHT / 2 + 50, 'btnStart');
    this.playButton.anchor.set(.5, .5);
    this.playButton.inputEnabled = true;
    this.playButton.events.onInputDown.add(this.playGame, this);
    this.add.tween(this.playButton).from({alpha: 0}, 1000, Phaser.Easing.Quartic.Out, true, 50);
    
    //howto button
    this.howtoButton = this.add.sprite(TARGET_WIDTH / 2, TARGET_HEIGHT / 2 + 50, 'btnInstructions');
    this.howtoButton.anchor.set(.5, .5);
    this.howtoButton.inputEnabled = true;
    this.howtoButton.events.onInputDown.add(this.gotoHow, this);
    this.add.tween(this.howtoButton).from({alpha: 0}, 1000, Phaser.Easing.Quartic.Out, true, 100);

    //about button
    this.aboutButton = this.add.sprite(TARGET_WIDTH / 2  + 200, TARGET_HEIGHT / 2 + 50, 'btnAbout');
    this.aboutButton.anchor.set(.5, .5);
    this.aboutButton.inputEnabled = true;
    this.aboutButton.events.onInputDown.add(this.gotoAbout, this);
    this.add.tween(this.aboutButton).from({alpha: 0}, 1000, Phaser.Easing.Quartic.Out, true, 150);
  },
  playGame: function() {
    //JS.. is stupid sometimes.
    this.game.state.start('hub');
    FingerPuppets.music.stop();
  },
  gotoAbout: function() {
    this.game.state.start('about');
  },
  gotoHow: function() {
    this.game.state.start('howto');
  }
};

module.exports = Menu;