/*global State, Config, Phaser*/

State.HowToPlay = function (game) {
	"use strict";
	this.game = game;
};
State.HowToPlay.prototype = {
	preload: function () {
		"use strict";
	},
	create: function () {
		"use strict";
		var background = this.game.add.sprite(Config.howToPlay.x, Config.howToPlay.y, 'how-to-play');
		background.inputEnabled = true;
		background.events.onInputDown.add(this.onClick, this);
	},
	update: function () {
		"use strict";
		Config.global.screen.resize(this.game);
		if (this.game.input.keyboard.isDown(Phaser.Keyboard.ENTER)) {
			this.game.state.start('Menu');
		}
	},
	onClick: function () {
		"use strict";
		this.game.state.start('Menu');
	}
};
State.HowToPlay = function (game) {
    "use strict";

    this.game = game;
};

State.HowToPlay.prototype = {
    preload: function () {
        "use strict";

        this.game.load.image('howtoplay-bg', Config.howToPlay.dir);
    },
    create: function () {
        "use strict";

        var background = this.game.add.sprite(Config.howToPlay.x,
                Config.howToPlay.y, 'howtoplay-bg');
        var backButton = this.game.add.button(Config.Menu.buttonBack.x,
                Config.Menu.buttonBack.y, 'button-back', this.backToMenu,
                this, 1, 0, 1, 0);
    },
    backToMenu: function () {
        "use strict";

        this.game.state.start('menu-state');
    }
};
Add the How To Play state
Add the How To Play state

Add the state that shows the player how to play the game.

The background is not added in this state now. It will be added in a
future patch.
