<commit_before>function GameController() {
  this.player;
  this.platforms;
  this.cursors;
  this.spacebar;
  this.shootWeapon;
  this.orbs;
  this.redOrbs;
  this.score;
  this.scoreText;
  this.world;
  this.game;
  this.healthbar;
  this.endGame;
}

GameController.prototype.run = function() {
  game = new Phaser.Game(800, 600, Phaser.AUTO, 'gameDiv', { preload: this.preload, create: this.create, update: this.update, render: this.render });
  endGame = new EndGame(game);
}

GameController.prototype.preload = function() {
  game.load.image('sky', 'assets/sky.png');
  game.load.image('ground', 'assets/platform copy.png');
  game.load.image('redOrb', 'assets/unsafe_orb.png');
  game.load.image('diamond', 'assets/diamond.png')
  game.load.image('blueOrb', 'assets/safe_orb.png');
  game.load.spritesheet('dude', 'assets/dude.png', 32, 48);
  endGame.loadAssets();
}

GameController.prototype.create = function() {

  // CREATE THE WORLD
  world = new World();
  world.setCanvas(game, 0, 0, 1600, 600);

  // Set fullscreen on mouseclick
  game.input.onDown.add(world.setFullscreen, game);

  game.physics.startSystem(Phaser.Physics.ARCADE);

  var sky = game.add.sprite(0, 0, 'sky');
  sky.scale.setTo(10,1);

  platforms = game.add.group();
  //  Enable physics
  platforms.enableBody = true;

  var ground = platforms.create(0, game.world.height + 60);
  ground.scale.setTo(100, 1);
  // This stops it from falling away when you jump on it
  ground.body.immovable = true;

  var ledge = platforms.create(400, 400, 'ground');
  ledge.body.immovable = true;
  ledge.lifespan = 10000;

  // CREATE ASTERIA
  asteria = new Asteria(game, 500, 0);
  player = asteria.sprite;

  // Initializing asteria's healthbar //
 
  // player.maxHealth = 5
  // player.health = 5

  healthbar = game.add.group();
  for (var i = 0; i < 5; i++) {
    var diamond = healthbar.create(i * 20, 0, 'diamond');
  }

  //  We need to enable physics on the player
  game.physics.arcade.enable(player);
  asteria.entersTheScene();
  asteria.setMotions();

  // Set the camera<commit_msg>locked healthbar onto screen<commit_after>function GameController() {
  this.player;
  this.platforms;
  this.cursors;
  this.spacebar;
  this.shootWeapon;
  this.orbs;
  this.redOrbs;
  this.score;
  this.scoreText;
  this.world;
  this.game;
  this.healthbar;
  this.endGame;
}

GameController.prototype.run = function() {
  game = new Phaser.Game(800, 600, Phaser.AUTO, 'gameDiv', { preload: this.preload, create: this.create, update: this.update, render: this.render });
  endGame = new EndGame(game);
}

GameController.prototype.preload = function() {
  game.load.image('sky', 'assets/sky.png');
  game.load.image('ground', 'assets/platform copy.png');
  game.load.image('redOrb', 'assets/unsafe_orb.png');
  game.load.image('diamond', 'assets/diamond.png')
  game.load.image('blueOrb', 'assets/safe_orb.png');
  game.load.spritesheet('dude', 'assets/dude.png', 32, 48);
  endGame.loadAssets();
}

GameController.prototype.create = function() {

  // CREATE THE WORLD
  world = new World();
  world.setCanvas(game, 0, 0, 1600, 600);

  // Set fullscreen on mouseclick
  game.input.onDown.add(world.setFullscreen, game);

  game.physics.startSystem(Phaser.Physics.ARCADE);

  var sky = game.add.sprite(0, 0, 'sky');
  sky.scale.setTo(10,1);

  platforms = game.add.group();
  //  Enable physics
  platforms.enableBody = true;

  var ground = platforms.create(0, game.world.height + 60);
  ground.scale.setTo(100, 1);
  // This stops it from falling away when you jump on it
  ground.body.immovable = true;

  var ledge = platforms.create(400, 400, 'ground');
  ledge.body.immovable = true;
  ledge.lifespan = 10000;

  // CREATE ASTERIA
  asteria = new Asteria(game, 500, 0);
  player = asteria.sprite;

  // Initializing asteria's healthbar //
 
  // player.maxHealth = 5
  // player.health = 5

  healthbar = game.add.group();
  for (var i = 0; i < 5; i++) {
    var diamond = healthbar.create(i * 20, 0, 'diamond');
  }
  
  healthbar.fixedToCamera = true;

  //  We need to enable physics on the player
  game.physics.arcade.enable(player);
  asteria.entersTheScene();
  asteria.setMotions();

  // Set the camera
{'fraction_non_alphanumeric': 0.15441527446300715, 'fraction_numerical': 0.025298329355608593, 'mean_word_length': 3.65149833518313, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2128011', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1477, 'n_words': 320}