function Picker() {
  this.drawButton;
  this.timer;
  this.countdownText;
  this.countdown;
}

Picker.prototype = {
  preload: function() {
      this.load.image("nose", "assets/nose/nose.png");
      this.load.image("booger", "assets/nose/booger.png");
  },
  create: function() {

    this.countdown = 10;

    var text = this.countdown;
    var style = { font: "65px Arial", fill: "#ff0044", align: "center" };
    this.countdownText = this.add.text(this.world.centerX-300, 0, text, style);

    //start the timer
    this.timah = this.time.create(false);
    this.timah.loop(1000, this.updateCountdown, this);
    this.timah.start();

    this.nose = this.add.sprite(Math.random() * window.width, Math.random() * window.height, "nose");
    this.nose.inputEnabled = true;
    this.nose.events.onInputDown.add(this.picked, this);
  },
  update: function() {

  },
  picked: function() {

    this.nose.x = Math.random() * window.TARGET_WIDTH;
    this.nose.y = Math.random() * window.TARGET_HEIGHT; 
  },
  updateCountdown: function() {
      this.countdown --;
      if(this.countdown <= 0) {

       // if(this.finalScore >= 50) {
        //  FingerPuppets.score++;
       // }

        this.timah.stop();
        this.countdownText.setText("");
      } else {
        this.countdownText.setText( this.countdown );
      }
  },
};

module.exports = Picker;