<commit_before>
var racing = true;

var raceCar = function (ID, keyNum, name) {
  this.carElement = document.getElementById(ID);
  this.playerInfoElement = document.getElementById(ID + "-info");
  this.playerNameElement = document.getElementById(ID + "-info-name");
  this.playerKeyElement = document.getElementById(ID + "-info-key");
  this.position = 0;
  this.speed = 0;
  this.keyNum = keyNum;
  this.name = name;
  this.buttonPush = function () {
    this.speed += 0.2;
  }
  this.update = function () {
    if (racing) {
      this.position += this.speed;
      this.carElement.style.left = this.position + 'px';
      if(this.speed > 0) {
        console.log(this.name + " Speed: " + this.speed + " px/sec");
        this.speed -= 0.01;
      }
      if (this.position > this.carElement.parentElement.offsetWidth - this.carElement.offsetWidth) {
        carWins(this);

      }
    }
  }
  this.updatePlayerInfo = function () {
    this.playerNameElement.innerHTML = this.name;
    this.playerKeyElement.innerHTML = " Hit " + String.fromCharCode(this.keyNum) + " to go";
    // console.log "PlayerInfo - Name: " + this.name + " Key:" + String.fromCharCode(this.keyNum);
  }
};

// var raceCar1 = document.getElementById("car-1");
// var raceCar2 = document.getElementById("car-2");
// var raceCar3 = document.getElementById("car-3");
// var raceCar4 = document.getElementById("car-4");
var raceCars = [];
raceCars[0] = new raceCar("car-1",65, "Player 1");
raceCars[1] = new raceCar("car-2",68, "Player 2");
raceCars[2] = new raceCar("car-3",71, "Player 3");
raceCars[3] = new raceCar("car-4",74, "Player 4");

// var raceCar1Pos = 0;

window.addEventListener("keyup", keyPressed);<commit_msg>changed race dynamics<commit_after>
var racing = true;

var raceCar = function (ID, keyNum, name) {
  this.carElement = document.getElementById(ID);
  this.playerInfoElement = document.getElementById(ID + "-info");
  this.playerNameElement = document.getElementById(ID + "-info-name");
  this.playerKeyElement = document.getElementById(ID + "-info-key");
  this.position = 0;
  this.speed = 0;
  this.keyNum = keyNum;
  this.name = name;
  this.buttonPush = function () {
    this.speed += 0.3;
  }
  this.update = function () {
    if (racing) {
      this.position += this.speed;
      this.carElement.style.left = this.position + 'px';
      if(this.speed > 0) {
        console.log(this.name + " Speed: " + this.speed + " px/sec");
        this.speed -= 0.05;
      }
      if (this.position > this.carElement.parentElement.offsetWidth - this.carElement.offsetWidth) {
        carWins(this);

      }
    }
  }
  this.updatePlayerInfo = function () {
    this.playerNameElement.innerHTML = this.name;
    this.playerKeyElement.innerHTML = " Hit " + String.fromCharCode(this.keyNum) + " to go";
    // console.log "PlayerInfo - Name: " + this.name + " Key:" + String.fromCharCode(this.keyNum);
  }
};

// var raceCar1 = document.getElementById("car-1");
// var raceCar2 = document.getElementById("car-2");
// var raceCar3 = document.getElementById("car-3");
// var raceCar4 = document.getElementById("car-4");
var raceCars = [];
raceCars[0] = new raceCar("car-1",65, "Player 1");
raceCars[1] = new raceCar("car-2",68, "Player 2");
raceCars[2] = new raceCar("car-3",71, "Player 3");
raceCars[3] = new raceCar("car-4",74, "Player 4");

// var raceCar1Pos = 0;

window.addEventListener("keyup", keyPressed);
{'fraction_non_alphanumeric': 0.17028772753963595, 'fraction_numerical': 0.022313564298297124, 'mean_word_length': 3.441981747066493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '840612', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1136, 'n_words': 219}