function InstructionsInterlude() {
  this.instructionText;
  this.timah;
  this.nextGameInfo;
}

InstructionsInterlude.prototype = {
  preload: function() {
  },
  create: function() {

    //background for game
    this.add.sprite(0,0, "bg");

    this.nextGameInfo = FingerPuppets.gameOptions[FingerPuppets.nextGame];

    var style = { font: "65px LightUpTheWorld", fill: "#222", align: "center" };
    this.instructionText = this.add.text(this.world.centerX, this.world.centerY, this.nextGameInfo.instructions, style);
    this.instructionText.anchor.setTo(.5, 1);

    //start the timer
    this.timah = this.time.create(false);
    this.timah.add(2000, this.moveOn, this);
    this.timah.start();

    //animate text
    this.add.tween(this.instructionText).to({y: "+30"}, 700, Phaser.Easing.Elastic.Out, true);
  },
  moveOn: function() {
      this.game.state.start(this.nextGameInfo.state);
  }
};

module.exports = InstructionsInterlude;