<commit_before>var KeyTracker = require('./keyboard-tracker');
var FoodGenerator = require('./food-generator');
var ShapeDrawer = require('./shape-drawer');

var canvas = document.getElementById('game');
var ctx = canvas.getContext('2d');
var keyTrack = new KeyTracker();
var foodGen = new FoodGenerator(canvas, ctx);
var shapeDrawer = new ShapeDrawer(canvas, ctx);

function Player(name, x, y, mass) {
  this.name = name;
  this.x    = x;
  this.y    = y;
  this.mass = mass;
  this.keyTracker = keyTrack;
}

Player.prototype = {
  draw: function() {
    ctx.beginPath();
    ctx.arc(this.x, this.y, 5, 0, Math.PI * 2);
    ctx.fill();
    return this;
  },

  move: function() {
    if (this.name === 'Player 1') {
      if(this.keyTracker.isPressed(this.keyTracker.KEYS.LEFT)) {
        this.x--;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.RIGHT)) {
        this.x++;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.UP)) {
        this.y--;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.DOWN)) {
        this.y++;
      }
    } else if (this.name === 'Player 2') {
      if(this.keyTracker.isPressed(this.keyTracker.KEYS.A)) {
        this.x--;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.D)) {
        this.x++;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.W)) {
        this.y--;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.S)) {
        this.y++;
      }
    }
    return this;
  }
};

var players = [];
players.push(new Player('Player 1',200,50,100));
players.push(new Player('Player 2',250,50,100));

var food = foodGen.seed();

requestAnimationFrame(function gameLoop() {
  ctx.clearRect(0, 0, canvas.width, canvas.height);
  for(var i = 0; i < players.length; i++) {
    players[i].draw().move();
  }
  for(var i = 0; i < food.length; i++) {
    shapeDrawer.drawFood(food[i]);
  }
  requestAnimationFrame(gameLoop);
});
<commit_msg>Fixing merge conflicts from master<commit_after>var KeyTracker = require('./keyboard-tracker');
var FoodGenerator = require('./food-generator');
var ShapeDrawer = require('./shape-drawer');

var canvas = document.getElementById('game');
var ctx = canvas.getContext('2d');
var keyTrack = new KeyTracker();
var foodGen = new FoodGenerator(canvas, ctx);
var shapeDrawer = new ShapeDrawer(canvas, ctx);

function Player(name, x, y, mass) {
  this.name = name;
  this.x    = x;
  this.y    = y;
  this.mass = mass;
  this.keyTracker = keyTrack;
}

Player.prototype = {
  draw: function() {
    ctx.beginPath();
    ctx.arc(this.x, this.y, 5, 0, Math.PI * 2);
    ctx.fill();
    return this;
  },

  move: function() {
    if (this.name === 'Player 1') {
      if(this.keyTracker.isPressed(this.keyTracker.KEYS.LEFT)) {
        this.x--;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.RIGHT)) {
        this.x++;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.UP)) {
        this.y--;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.DOWN)) {
        this.y++;
      }
    } else if (this.name === 'Player 2') {
      if(this.keyTracker.isPressed(this.keyTracker.KEYS.A)) {
        this.x--;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.D)) {
        this.x++;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.W)) {
        this.y--;
      }
      if (this.keyTracker.isPressed(this.keyTracker.KEYS.S)) {
        this.y++;
      }
    }
    return this;
  }
};

var players = [];
players.push(new Player('Player 1',200,50,100));
players.push(new Player('Player 2',250,50,100));

var food = foodGen.seed();

requestAnimationFrame(function gameLoop() {
  ctx.clearRect(0, 0, canvas.width, canvas.height);

  for(var i = 0; i < players.length; i++) {
    players[i].draw().move();
  }

  for(var i = 0; i < food.length; i++) {
    shapeDrawer.drawFood(food[i]);
  }
  
  requestAnimationFrame(gameLoop);
});

{'fraction_non_alphanumeric': 0.17468354430379746, 'fraction_numerical': 0.014177215189873417, 'mean_word_length': 2.7844827586206895, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2699654', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1397, 'n_words': 252}