<commit_before>//This sets the variable for the mouse
var mouse;

//This sets the score to start at -1.
var score = -1;

//This is the object which runs the game.
var mainState = {
	preload: function(){
		//These four things sets the assets for the game.
		game.load.image('ship', 'assets/ship.png');
		game.load.image('enemy', 'assets/enemy.png')
	},

	create: function(){
		//This sets the game physics to Arcade style.
		game.physics.startSystem(Phaser.Physics.ARCADE);

		//This sets the background color to something.
		game.stage.backgroundColor = 'purple';

				//This gives us sharp corners for all of our images.
		game.renderer.renderSession.roundPixels = true;

		//This would be a good place to start the general background music for the game.

		this.obstacle = game.add.sprite(200, 200, 'ship');
		this.obstacle.scale.setTo(0.15,0.15);
		this.obstacle.anchor.setTo(0,1);
		game.physics.arcade.enable(this.obstacle);
		this.obstacle.body.immovable = false;

		//The enemy testing
		this.enemy = game.add.sprite(800,550, 'enemy');
		this.enemy.scale.setTo(1,1);
		this.enemy.anchor.setTo(2,2);
		game.physics.arcade.enable(this.enemy);
		this.enemy.body. immovable = true;
	},

	update: function(){
		game.physics.arcade.collide(this.ship, this.enemy);
	}
};

//This sets the size of the game screen and sets it to the div "gameDiv".
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'gameDiv');

//This starts the game, by running the object "mainState".
game.state.add('main', mainState);
game.state.start('main');<commit_msg>WHY<commit_after>//This sets the variable for the mouse.
var mouse;

//This sets the variable for the ship.
var ship;

//This sets the score to start at -1.
var score = -1;

//This is the object which runs the game.
var mainState = {
	preload: function(){
		//These four things sets the assets for the game.
		game.load.image('ship', 'assets/ship.png');
		game.load.image('enemy', 'assets/enemy.png')
	},
	create: function(){
		//This sets the game physics to Arcade style.
		game.physics.startSystem(Phaser.Physics.ARCADE);

		//enable the game physics
		game.physics.enable('ship', Phaser.Physics.ARCADE);

		//This sets the background color to something.
		game.stage.backgroundColor = 'purple';

				//This gives us sharp corners for all of our images.
		game.renderer.renderSession.roundPixels = true;

		//This would be a good place to start the general background music for the game.

		this.obstacle = game.add.sprite(200, 200, 'ship');
		this.obstacle.scale.setTo(0.15,0.15);
		this.obstacle.anchor.setTo(0,1);
		game.physics.arcade.enable(this.obstacle);
		this.obstacle.body.immovable = false;

		//The enemy testing
		this.enemy = game.add.sprite(800,550, 'enemy');
		this.enemy.scale.setTo(1,1);
		this.enemy.anchor.setTo(2,2);
		game.physics.arcade.enable(this.enemy);
		this.enemy.body. immovable = true;
	},

	update: function(){
		game.physics.arcade.collide(this.ship, this.enemy);
	      game.physics.arcade.moveToPointer('ship', 400);

	      //  if it's overlapping the mouse, don't move any more
	      if (Phaser.Rectangle.contains(this.ship.body, game.input.x, game.input.y))
	      {
	      	//It's not getting the velocity for some reason.
	          this.ship.body.velocity.setTo(0, 0);
	      }
	}
};

//This sets the size of the game screen and sets it to the div "gameDiv".
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'gameDiv');

//This starts the game, by running the object "mainState".
game.state.add('main', mainState);
game.state.start('main');
{'fraction_non_alphanumeric': 0.1398184912081679, 'fraction_numerical': 0.019568916619398753, 'mean_word_length': 3.527599486521181, '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': '2484792', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1209, 'n_words': 341}