<commit_before>var _ = require('underscore');

var Controller = function (game, player, device) {
  this.game = game;
  this.device = device;
  this.buttonA = null;
  this.player = player;
  this.device.addCallbacks(this, { onConnect: _.bind(this.addButtons, this) });
}

Controller.prototype.addButtons = function () {
  var game = this.game;
<<<<<<< Updated upstream
=======
  if (this.device.index === 0) {
    console.log('creating device 1')
    this.imageA = game.add.image(200, 300, 'xbox360', '360_A');
  } else {
    console.log('creating device 2')
    this.imageA = game.add.image(500, 300, 'xbox360', '360_A');
  }
>>>>>>> Stashed changes

  //  We can't do this until we know that the gamepad has been connected and is started
  this.buttonA = this.device.getButton(Phaser.Gamepad.XBOX360_A);
  this.buttonA.onDown.add(onDown, this);
  this.buttonA.onUp.add(onUp, this);
}

function onDown (button, value) {
  if (button.buttonCode === Phaser.Gamepad.XBOX360_A) {
   this.player.choose();
  }
}
<commit_msg>fix merge conflict<commit_after>var _ = require('underscore');

var Controller = function (game, player, device) {
  this.game = game;
  this.device = device;
  this.buttonA = null;
  this.player = player;
  this.device.addCallbacks(this, { onConnect: _.bind(this.addButtons, this) });
}

Controller.prototype.addButtons = function () {
  var game = this.game;
  //  We can't do this until we know that the gamepad has been connected and is started
  this.buttonA = this.device.getButton(Phaser.Gamepad.XBOX360_A);
  this.buttonA.onDown.add(onDown, this);
  this.buttonA.onUp.add(onUp, this);
}

function onDown (button, value) {
  if (button.buttonCode === Phaser.Gamepad.XBOX360_A) {
   this.player.choose();
  }
}

{'fraction_non_alphanumeric': 0.15313759355210133, 'fraction_numerical': 0.022452504317789293, 'mean_word_length': 4.023121387283237, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '81060', 'n_tokens_mistral': 641, 'n_tokens_neox': 606, 'n_words': 136}