<commit_before>// Game state.
var highScore = 0;
var points = 0;

var hardMode = true;

var gameState = {
  // Custom "variables".
  tweenAPosition: 900,
  tweenBPosition: 70,

  textTween: null,
	tempScore: 0,
  text: null,

  walls: null,

  score: 0,

  // Native functions.
  preload: function() {
		var str_score = localStorage.getItem('highScore');

		if (str_score == null || str_score == "null") {
			highscore = 0;
		} else {
			highScore = parseInt(str_score);
		}

		var str_character = localStorage.getItem('character');

		if (str_character == null || str_character == "null") {
			character = 0;
		} else {
			character = parseInt(str_character);
		}

		localStorage.clear();

		game.load.image('ball', 'assets/balls/image.' + character + '.png');
		game.load.image('goal', 'assets/image.png');

		game.load.image('wall1', 'assets/image.png');
		game.load.image('wall2', 'assets/image.png');
	},

  create: function() {
		// this has to be active for the fps to be counting.
		game.time.advancedTiming = true;

		game.stage.backgroundColor = '#C85A17';
		game.physics.startSystem(Phaser.Physics.ARCADE);
		game.physics.arcade.gravity.y = 1000;

		// Add gameobjects to game
		this.ball = game.add.sprite(game.world.centerX, 20, 'ball');
		this.goal = game.add.sprite(this.tweenAPosition, game.world.height - 50, 'goal');

		this.wall1 = game.add.sprite(-64, game.world.height, 'wall1');
		this.wall2 = game.add.sprite(game.world.width + 64, game.world.height, 'wall2');

		game.physics.arcade.enable([
			this.ball,
      this.goal,
      this.wall1,
      this.wall2
      ]);

		// Ball setup
		this.ball.anchor.setTo(0.5, 0.5);
		this.ball.body.bounce.setTo(0.9, 0.9);

		// Goal setup
		this.goal.anchor.setTo(0.5, 0.5);
		this.goal.body.immovable = true;
		this.goal.body.allowGravity = false;

		// Walls setup
		this.wall1.anchor.setTo(0.5, 1);
		this.wall2.anchor.setTo(0.5, 1);
		this.wall1.scale.setTo(0.5, 50);
		this.wall2.scale.setTo(0.5, 50);

		this.wall1.body.immovable = true;
		this.wall2.body.immovable = true;
		this.wall1.body.allowGravity = false;
		this.wall2.body.allowGravity = false;

		walls = game.add.group();

		walls.add(this.wall1);
		walls.add(this.wall2);

		var escKey = game.input.keyboard.addKey(Phaser.Keyboard.Q);
		escKey.onDown.add(this.goToMain, this);

		game.input.onDown.add(this.bounce, this);

		//set the goals tweens.
		tweenA = game.add.tween(this.goal).to({ x: this.tweenAPosition }, 2500, 'Linear', true, 0);
		tweenB = game.add.tween(this.goal).to({ x: this.tweenBPosition }, 2500, 'Linear', true, 0);

		//set score text
		scoreText = game.add.text(game.world.centerX, 20, "0");

		//	Font style
		scoreText.font = 'Arial Black';
		scoreText.fontSize = 50;
		scoreText.fontWeight = 'bold';

		//	Stroke color and thickness
		scoreText.stroke = '#0020C2';
		scoreText.strokeThickness = 5;
		scoreText.fill = '#2B65EC';

		textTween = game.add.tween(scoreText).to({ fontSize:100}, 100, Phaser.Easing.Linear.None, false, 0,0,true);
  },
<commit_msg>Moved group definition to preload.<commit_after>// Game state.
var highScore = 0;
var points = 0;

var hardMode = true;

var gameState = {
  // Custom "variables".
  tweenAPosition: 900,
  tweenBPosition: 70,

  textTween: null,
	tempScore: 0,
  text: null,

  walls: null,

  score: 0,

  // Native functions.
  preload: function() {
		var str_score = localStorage.getItem('highScore');

		if (str_score == null || str_score == "null") {
			highscore = 0;
		} else {
			highScore = parseInt(str_score);
		}

		var str_character = localStorage.getItem('character');

		if (str_character == null || str_character == "null") {
			character = 0;
		} else {
			character = parseInt(str_character);
		}

		localStorage.clear();

		walls = game.add.group();

		game.load.image('ball', 'assets/balls/image.' + character + '.png');
		game.load.image('goal', 'assets/image.png');

		game.load.image('wall1', 'assets/image.png');
		game.load.image('wall2', 'assets/image.png');
	},

  create: function() {
		// this has to be active for the fps to be counting.
		game.time.advancedTiming = true;

		game.stage.backgroundColor = '#C85A17';
		game.physics.startSystem(Phaser.Physics.ARCADE);
		game.physics.arcade.gravity.y = 1000;

		// Add gameobjects to game
		this.ball = game.add.sprite(game.world.centerX, 20, 'ball');
		this.goal = game.add.sprite(this.tweenAPosition, game.world.height - 50, 'goal');

		this.wall1 = game.add.sprite(-64, game.world.height, 'wall1');
		this.wall2 = game.add.sprite(game.world.width + 64, game.world.height, 'wall2');

		game.physics.arcade.enable([
			this.ball,
      this.goal,
      this.wall1,
      this.wall2
      ]);

		// Ball setup
		this.ball.anchor.setTo(0.5, 0.5);
		this.ball.body.bounce.setTo(0.9, 0.9);

		// Goal setup
		this.goal.anchor.setTo(0.5, 0.5);
		this.goal.body.immovable = true;
		this.goal.body.allowGravity = false;

		// Walls setup
		this.wall1.anchor.setTo(0.5, 1);
		this.wall2.anchor.setTo(0.5, 1);
		this.wall1.scale.setTo(0.5, 50);
		this.wall2.scale.setTo(0.5, 50);

		this.wall1.body.immovable = true;
		this.wall2.body.immovable = true;
		this.wall1.body.allowGravity = false;
		this.wall2.body.allowGravity = false;

		walls.add(this.wall1);
		walls.add(this.wall2);

		var escKey = game.input.keyboard.addKey(Phaser.Keyboard.Q);
		escKey.onDown.add(this.goToMain, this);

		game.input.onDown.add(this.bounce, this);

		//set the goals tweens.
		tweenA = game.add.tween(this.goal).to({ x: this.tweenAPosition }, 2500, 'Linear', true, 0);
		tweenB = game.add.tween(this.goal).to({ x: this.tweenBPosition }, 2500, 'Linear', true, 0);

		//set score text
		scoreText = game.add.text(game.world.centerX, 20, "0");

		//	Font style
		scoreText.font = 'Arial Black';
		scoreText.fontSize = 50;
		scoreText.fontWeight = 'bold';

		//	Stroke color and thickness
		scoreText.stroke = '#0020C2';
		scoreText.strokeThickness = 5;
		scoreText.fill = '#2B65EC';

		textTween = game.add.tween(scoreText).to({ fontSize:100}, 100, Phaser.Easing.Linear.None, false, 0,0,true);
  },

{'fraction_non_alphanumeric': 0.16812696313440237, 'fraction_numerical': 0.034055215738138536, 'mean_word_length': 3.3968023255813953, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5059790', 'n_tokens_mistral': 2621, 'n_tokens_neox': 2278, 'n_words': 432}