var Clickbutton = {

  score: 0

};

Clickbutton.Preloader = function () {};

Clickbutton.Preloader.prototype = {

  init: function () {

    this.input.maxPointers = 1;
    this.scale.pageAlignHorizontally = true;

  },

  preload: function() {

    this.load.path = 'assets/';

    this.load.image('love', 'love.png');
    this.load.image('boring', 'boring.png');
    this.load.image('cringe', 'cringe.png');
    this.load.image('knight', 'knight.png');
    this.load.image('mod', 'mod.png');
    this.load.image('rekt', 'rekt.png');
    this.load.image('sad', 'sad.png');
    this.load.image('schlick', 'schlick.png');
    this.load.image('seven', 'seven.png');

  },

  create: function() {

    this.state.start('Clickbutton.MainMenu');

  }

};

Clickbutton.MainMenu = function () {};

Clickbutton.MainMenu.prototype = {

  create: function () {

    this.stage.backgroundColor = 0x000000;

    var style = { font: "65px Arial", fill: "#ff0044", align: "center" };

    var text = game.add.text(game.world.centerX, game.world.centerY, "- START -\nClick Button\n- GAME -", style);

    text.anchor.set(0.5);

    this.input.onDown.addOnce(this.start, this);

  },

  start: function () {

    this.state.start('Clickbutton.Game');

  },

  update: function () {}

};

Clickbutton.Game = function() {

  this.score = 0;
  this.love = null;

};

Clickbutton.Game.prototype = {

  init: function() {

    this.score = 0;

  },

  create: function() {

    this.stage.backgroundColor = 0x000000;

    this.love = this.add.sprite(0, 0, 'love');
    this.love.inputEnabled = true;

    this.love.events.onInputDown.add(this.clickedIt, this);

  },

  clickedIt: function (sprite, pointer) {

    var x = this.rnd.between(0, this.game.width - this.love.width);
    var y = this.rnd.between(0, this.game.height - this.love.height);

    this.love.x = x;
    this.love.y = y;

  },

  update: function() {

    // this.love.x = this.world.randomX;
    // this.love.y = this.world.randomY;

  }

};

var game = new Phaser.Game(800, 450, Phaser.AUTO, 'game');

game.state.add('Clickbutton.Preloader', Clickbutton.Preloader);
game.state.add('Clickbutton.MainMenu', Clickbutton.MainMenu);
game.state.add('Clickbutton.Game', Clickbutton.Game);

game.state.start('Clickbutton.Preloader');

@@ -1317,16 +1317,114 @@
 re = 0;%0A
+  this.scoreText = null;%0A%0A  this.timer = null;%0A  this.timeText = null;%0A%0A  this.scoreText = null;%0A%0A
   this.l
@@ -1585,24 +1585,520 @@
  0x000000;%0A%0A
+    var scoreStyle = %7B font: %2216px Arial%22, fill: %22#fff%22, align: %22right%22 %7D;%0A    this.scoreText = game.add.text(100, 25, %22Hits: %22 + this.score, scoreStyle);%0A    this.scoreText.anchor.set(0.5);%0A%0A    var timeStyle = %7B font: %2216px Arial%22, fill: %22#fff%22, align: %22right%22 %7D;%0A    this.timeText = game.add.text(700, 25, %22Time: %22 + this.timeText, timeStyle);%0A    this.timeText.anchor.set(0.5);%0A%0A    this.timer = this.time.create(false);%0A    this.timer.add(10000, this.timeUp, this);%0A    this.timer.start();%0A%0A
     this.lov
@@ -2458,36 +2458,104 @@
 e.y = y;%0A%0A  
-%7D,%0A%0A  update
+  this.score++;%0A    this.scoreText.text = %22Hits: %22 + this.score;%0A%0A  %7D,%0A%0A  timeUp
 : function()
@@ -2565,52 +2565,102 @@
 %0A   
- //
  this.
-love.x = this.world.randomX;%0A 
+scoreText.text = %22Time up! Hits:%22 + this.score;%0A%0A    this.timeText.visible = false;%0A%0A
    
-//
  thi
@@ -2670,31 +2670,167 @@
 ove.
-y = this.world.randomY;
+inputEnabled = false;%0A%0A  %7D,%0A%0A  update: function() %7B%0A%0A    if (this.timeText.visible)%0A    %7B%0A      this.timeText.text = 10 - Math.floor(this.timer.seconds);%0A    %7D
 %0A%0A  

Add score text and a timer that both update