{"size": 1152, "ext": "js", "max_stars_repo_path": "src/states/Gameover.js", "max_stars_repo_name": "KodyBentley/Click-Game-ES6", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/states/Gameover.js", "max_issues_repo_name": "KodyBentley/Click-Game-ES6", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/states/Gameover.js", "max_forks_repo_name": "KodyBentley/Click-Game-ES6", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.0434782609, "max_line_length": 122, "alphanum_fraction": 0.6727430556}
import MenuButton from 'objects/MenuButton';


export default class Gameover extends Phaser.State {

	create() {

		let background = this.game.add.image(0, 0, 'sky');

		this.highScoreText = this.game.add.text(this.game.width * 0.5, 150, 'HIGHSCORE: ' + localStorage.getItem("highscore"), {
			fontSize: '32px',
			fill: 'black'
		});

		this.gameoverText = this.game.add.text(this.game.width * 0.5 - 85, 50, 'Game Over!', {
			fontSize: '32px',
			fill: 'black'
		});
		this.game.physics.arcade.enable(this.highScoreText);

		this.highScoreText.anchor.setTo(0.5, 0.5);

		let buttonPlay = new MenuButton(this.game, this.game.width * 0.5, 650, 'playButton', 'Game');

		//Added onOver and onOut tweens for play button
		buttonPlay.events.onInputOver.add(this.onOver, this);
		buttonPlay.events.onInputOut.add(this.onOut, this);
	}

		onOver(buttonPlay) {
		this.game.add.tween(buttonPlay.scale).to({
			x: 1.3,
			y: 1.3
		}, 350, Phaser.Easing.Linear.In).start();

	}

	//Tween play button when mouse is no longer over
	onOut(buttonPlay) {
		this.game.add.tween(buttonPlay.scale).to({
			x: 1,
			y: 1
		}, 350, Phaser.Easing.Linear.In).start();

	}
}