<commit_before>Game.MainMenuState = function () {
    this.redPlayText;
	this.regularPlayText;
	this.regularPlayTextBoundingBox;
	
	this.redTutorialText;
	this.regularTutorialText;
	this.regularTutorialTextBoundingBox;
	
	this.redCreditsText;
	this.regularCreditsText;
	this.regularCreditsTextBoundingBox;
};

Game.MainMenuState.prototype = {
    preload: function () {
		this.game.add.image(0, 0, 'gameStart');
		
		var self = this;
        this.game.input.keyboard.onDownCallback = function (args) {
            self.handleInput(args);
        };
	},
	
	create: function () {
		var fontSize = ScreensConsts.fontSize;
		var cameraWidth = this.game.camera.width;
		var cameraHeight = this.game.camera.height;
		var buttonMargin = 10;
        
		// play
		this.regularPlayText = this.game.add.bitmapText(cameraWidth - 450,
		                                                cameraHeight - 250,
														'silkscreenGray',
														'( )lay',
														fontSize);
		this.regularPlayTextBoundingBox = new Phaser.Rectangle(this.regularPlayText.x, this.regularPlayText.y,
                                                               this.regularPlayText.textWidth, this.regularPlayText.textHeight);
        
		// tutorial
		this.regularTutorialText = this.game.add.bitmapText(this.regularPlayText.x,
		                                                    this.regularPlayText.y + this.regularPlayText.textHeight + buttonMargin,
															'silkscreenGray',
															'( )utorial',
															fontSize);
		this.regularTutorialTextBoundingBox = new Phaser.Rectangle(this.regularTutorialText.x, this.regularTutorialText.y,
                                                                   this.regularTutorialText.textWidth, this.regularTutorialText.textHeight);

        // credits
		this.regularCreditsText = this.game.add.bitmapText(this.regularTutorialText.x,
													       this.regularTutorialText.y + this.regularTutorialText.textHeight + buttonMargin,
													       'silkscreenGray',
													       '( )redits',
													       fontSize);
        this.regularCreditsTextBoundingBox = new Phaser.Rectangle(this.regularCreditsText.x, this.regularCreditsText.y,
                                                                  this.regularCreditsText.textWidth, this.regularCreditsText.textHeight);
        
		// play
	    this.redPlayText = this.game.add.bitmapText(this.regularPlayText.x,
                                                    this.regularPlayText.y,
                                                    'silkscreenRed',
                                                    'p',
                                                    fontSize);
        this.redPlayText.x += (this.redPlayText.textWidth / 2.0) * 1.1;
		
		// tutorial
		this.redTutorialText = this.game.add.bitmapText(this.regularTutorialText.x,
                                                        this.regularTutorialText.y,
                                                        'silkscreenRed',
                                                        't',
                                                        fontSize);
        this.redTutorialText.x += (this.redTutorialText.textWidth / 2.0) * 1.4;
		
		// credits
		this.redCreditsText = this.game.add.bitmapText(this.regularCreditsText.x,
                                                       this.regularCreditsText.y,
                                                       'silkscreenRed',
                                                       'c',
                                                       fontSize);
        this.redCreditsText.x += (this.redCreditsText.textWidth / 2.0);
		
		Utils.fadeOutScreen(this.game, TweensConsts.fadeFillStyle, TweensConsts.fadeOutDuration, null);
    },
	
	handleInput: function (args) {
        var keyCode = args.keyCode;
        var letter = String.fromCharCode(keyCode);
		
		switch (letter) {
			case 'P':
			    this.navigateToGameplay();
                break;
			case 'T':
			    this.navigateToTutorial();
			    break;
			case 'C':
			    this.navigateToCredits();
			    break;
		}
		
		args.preventDefault();
	},

	navigateToGameplay: function () {
		var self = this;
        self.game.input.keyboard.onDownCallback = null;
        Utils.fadeInScreen(this.game, TweensConsts.fadeFillStyle, TweensConsts.fadeInDuration, function () {
        	Game.GameState.currentLevel = 0;
            self.state.start('GameState');
        });
	},

	navigateToTutorial: function () {
        var self = this;
        self.game.input.keyboard.onDownCallback = null;
	    Utils.fadeInScreen(this.game, TweensConsts.fadeFillStyle, TweensConsts.fadeInDuration, function () {
            self.state.start('TutorialState');
        });<commit_msg>Asking player to sign in to Facebook when play button is pressed.<commit_after>Game.MainMenuState = function () {
    this.redPlayText;
	this.regularPlayText;
	this.regularPlayTextBoundingBox;
	
	this.redTutorialText;
	this.regularTutorialText;
	this.regularTutorialTextBoundingBox;
	
	this.redCreditsText;
	this.regularCreditsText;
	this.regularCreditsTextBoundingBox;
};

Game.MainMenuState.prototype = {
    preload: function () {
		this.game.add.image(0, 0, 'gameStart');
		
		var self = this;
        this.game.input.keyboard.onDownCallback = function (args) {
            self.handleInput(args);
        };
	},
	
	create: function () {
		var fontSize = ScreensConsts.fontSize;
		var cameraWidth = this.game.camera.width;
		var cameraHeight = this.game.camera.height;
		var buttonMargin = 10;
        
		// play
		this.regularPlayText = this.game.add.bitmapText(cameraWidth - 450,
		                                                cameraHeight - 250,
														'silkscreenGray',
														'( )lay',
														fontSize);
		this.regularPlayTextBoundingBox = new Phaser.Rectangle(this.regularPlayText.x, this.regularPlayText.y,
                                                               this.regularPlayText.textWidth, this.regularPlayText.textHeight);
        
		// tutorial
		this.regularTutorialText = this.game.add.bitmapText(this.regularPlayText.x,
		                                                    this.regularPlayText.y + this.regularPlayText.textHeight + buttonMargin,
															'silkscreenGray',
															'( )utorial',
															fontSize);
		this.regularTutorialTextBoundingBox = new Phaser.Rectangle(this.regularTutorialText.x, this.regularTutorialText.y,
                                                                   this.regularTutorialText.textWidth, this.regularTutorialText.textHeight);

        // credits
		this.regularCreditsText = this.game.add.bitmapText(this.regularTutorialText.x,
													       this.regularTutorialText.y + this.regularTutorialText.textHeight + buttonMargin,
													       'silkscreenGray',
													       '( )redits',
													       fontSize);
        this.regularCreditsTextBoundingBox = new Phaser.Rectangle(this.regularCreditsText.x, this.regularCreditsText.y,
                                                                  this.regularCreditsText.textWidth, this.regularCreditsText.textHeight);
        
		// play
	    this.redPlayText = this.game.add.bitmapText(this.regularPlayText.x,
                                                    this.regularPlayText.y,
                                                    'silkscreenRed',
                                                    'p',
                                                    fontSize);
        this.redPlayText.x += (this.redPlayText.textWidth / 2.0) * 1.1;
		
		// tutorial
		this.redTutorialText = this.game.add.bitmapText(this.regularTutorialText.x,
                                                        this.regularTutorialText.y,
                                                        'silkscreenRed',
                                                        't',
                                                        fontSize);
        this.redTutorialText.x += (this.redTutorialText.textWidth / 2.0) * 1.4;
		
		// credits
		this.redCreditsText = this.game.add.bitmapText(this.regularCreditsText.x,
                                                       this.regularCreditsText.y,
                                                       'silkscreenRed',
                                                       'c',
                                                       fontSize);
        this.redCreditsText.x += (this.redCreditsText.textWidth / 2.0);
		
		Utils.fadeOutScreen(this.game, TweensConsts.fadeFillStyle, TweensConsts.fadeOutDuration, null);
    },
	
	handleInput: function (args) {
        var keyCode = args.keyCode;
        var letter = String.fromCharCode(keyCode);
		
		switch (letter) {
			case 'P':
			    this.navigateToGameplay();
                break;
			case 'T':
			    this.navigateToTutorial();
			    break;
			case 'C':
			    this.navigateToCredits();
			    break;
		}
		
		args.preventDefault();
	},

	navigateToGameplay: function () {
		Facebook.getLoginStatus();

		var self = this;
        self.game.input.keyboard.onDownCallback = null;
        Utils.fadeInScreen(this.game, TweensConsts.fadeFillStyle, TweensConsts.fadeInDuration, function () {
        	Game.GameState.currentLevel = 0;
            self.state.start('GameState');
        });
	},

	navigateToTutorial: function () {
        var self = this;
        self.game.input.keyboard.onDownCallback = null;
	    Utils.fadeInScreen(this.game, TweensConsts.fadeFillStyle, TweensConsts.fadeInDuration, function () {
            self.state.start('TutorialState');
        });
{'fraction_non_alphanumeric': 0.09303534303534304, 'fraction_numerical': 0.004365904365904366, 'mean_word_length': 1.5238719832109129, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 70, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7049919', 'n_tokens_mistral': 2953, 'n_tokens_neox': 2460, 'n_words': 350}