<commit_before>//Where did the bridge go?
//How do we get the bridge to be treated like a .land?

var whistleSFX;

$(document).ready(function() { 
  whistleSFX = document.getElementById("train-whistle");
  move();
  $("#go-button").on("click", function(){ 
    train.start(3); 
    train.move();
  }); 
  reset();
  $("#reset-button").on("click", function() {
    train.reset();
  });
  makeBridge();
  $("#block-maker").on("click", function() {
    bridge.start(); 
    bridge.makeBridge();
    return false;
  });
});

function move() {
  train.move();
  window.requestAnimationFrame(move);
}

function reset() {
  train.reset();
}

var train = {
  xPos: 0,
  yPos: 0,
  height: 0,
  width: 0,
  color: 0,
  xVel: 0,
  yVel: 0,
  gravity: .06125,
  gravy: true,
    
  start: function(speed) {
    if (this.xVel == 0 && this.xPos == 0) {
      whistleSFX.play();
    }
    this.xVel = speed;
  },
  
  move: function() {
        
    this.xPos = this.xPos + this.xVel;
    if (this.xPos > 800) {
      this.hammerTime(); 
    }
    
    this.yVel = this.yVel + this.gravity;
    this.yPos = this.yPos + this.yVel;
    var that = this;
    
    $(".ground").each(function() {
      var land = $(this);
      var position = land.position();
      var leftEdge = position.left;
      var rightEdge = position.left + land.width();
      
      if(that.xPos >= leftEdge && that.xPos <= rightEdge && that.yPos >= (position.top -16)) {
        if(that.yPos >= (position.top - 16)) {
          that.yPos = position.top - 16;
          that.yVel = 0;
        }
      } else {<commit_msg>Fixed train jumping to bridges in the sky<commit_after>//Where did the bridge go?
//How do we get the bridge to be treated like a .land?

var whistleSFX;

$(document).ready(function() { 
  whistleSFX = document.getElementById("train-whistle");
  move();
  $("#go-button").on("click", function(){ 
    train.start(3); 
    train.move();
  }); 
  reset();
  $("#reset-button").on("click", function() {
    train.reset();
  });
  makeBridge();
  $("#block-maker").on("click", function() {
    bridge.start(); 
    bridge.makeBridge();
    return false;
  });
});

function move() {
  train.move();
  window.requestAnimationFrame(move);
}

function reset() {
  train.reset();
}

var train = {
  xPos: 0,
  yPos: 0,
  height: 0,
  width: 0,
  color: 0,
  xVel: 0,
  yVel: 0,
  gravity: .06125,
  gravy: true,
    
  start: function(speed) {
    if (this.xVel == 0 && this.xPos == 0) {
      whistleSFX.play();
    }
    this.xVel = speed;
  },
  
  move: function() {
        
    this.xPos = this.xPos + this.xVel;
    if (this.xPos > 800) {
      this.hammerTime(); 
    }
    
    this.yVel = this.yVel + this.gravity;
    this.yPos = this.yPos + this.yVel;
    var that = this;
    
    $(".ground").each(function() {
      var land = $(this);
      var position = land.position();
      var leftEdge = position.left;
      var rightEdge = position.left + land.width();
      var topEdge = position.top - 16;
      var bottomEdge = position.top + land.height();
      
      if(that.xPos >= leftEdge && that.xPos <= rightEdge && that.yPos >= topEdge && that.yPos <= bottomEdge) {
          that.yPos = position.top - 16;
          that.yVel = 0;
{'fraction_non_alphanumeric': 0.1771091811414392, 'fraction_numerical': 0.01488833746898263, 'mean_word_length': 2.3840503672612803, 'pattern_counts': {'":': 0, '<': 6, '<?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': '5585748', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1126, 'n_words': 258}