<commit_before>const scoreboard = require('./scoreboard');
const collisionSound = new Audio();
const $ = require('jquery')

const startButtonClick = (game) => {
  game.canvas.addEventListener('click', function checkForButtonClick(e) {
    if (e.offsetY > 225 && e.offsetY < 290 && e.offsetX > 190 && e.offsetX < 300) {
      game.canvas.removeEventListener('click', checkForButtonClick);
      game.reset();
      }
  });
}

const launchJorgeMode = (game) => {
  window.addEventListener('keydown', function(e) {
    if (e.which === 74) {
      $('body').addClass('jorge')
      game.bird.jorgeMode();
      game.pipes[0].mode = 'jorge';
      game.pipes[1].mode = 'jorge';
    }
  });
}

const launchBirdMode = (game) => {
  window.addEventListener('keydown', function(e) {
    if (e.which === 66) {
      $('body').removeClass('jorge')
      game.bird.birdMode();
      game.pipes[0].mode = 'bird';
      game.pipes[1].mode = 'bird';
    }
  });
}

const addBirdMoveEvents = (game) => {
  game.score.increment;
  game.canvas.addEventListener('click', () => { game.bird.spacebarPress });
  document.addEventListener('keydown', (e) => {
    if (e.which == 32) { game.bird.spacebarPress }
  });
  game.collision.on('collisionEvent', () => {
    collisionSound.src = `/assets/sounds/${game.bird.mode}-hit.ogg`;
    collisionSound.play();<commit_msg>prevent keydown defaults<commit_after>const scoreboard = require('./scoreboard');
const collisionSound = new Audio();
const $ = require('jquery')

const startButtonClick = (game) => {
  game.canvas.addEventListener('click', function checkForButtonClick(e) {
    if (e.offsetY > 225 && e.offsetY < 290 && e.offsetX > 190 && e.offsetX < 300) {
      game.canvas.removeEventListener('click', checkForButtonClick);
      game.reset();
      }
  });
}

const launchJorgeMode = (game) => {
  window.addEventListener('keydown', function(e) {
    if (e.which === 74) {
      e.preventDefault();
      $('body').addClass('jorge')
      game.bird.jorgeMode();
      game.pipes[0].mode = 'jorge';
      game.pipes[1].mode = 'jorge';
    }
  });
}

const launchBirdMode = (game) => {
  window.addEventListener('keydown', function(e) {
    if (e.which === 66) {
      e.preventDefault();
      $('body').removeClass('jorge')
      game.bird.birdMode();
      game.pipes[0].mode = 'bird';
      game.pipes[1].mode = 'bird';
    }
  });
}

const addBirdMoveEvents = (game) => {
  game.score.increment;
  game.canvas.addEventListener('click', () => { game.bird.spacebarPress });
  document.addEventListener('keydown', (e) => {
    if (e.which == 32) {
      e.preventDefault();
      game.bird.spacebarPress
    }
  });
  game.collision.on('collisionEvent', () => {
    collisionSound.src = `/assets/sounds/${game.bird.mode}-hit.ogg`;
    collisionSound.play();
{'fraction_non_alphanumeric': 0.19132927266212826, 'fraction_numerical': 0.015764958796130418, 'mean_word_length': 3.355694227769111, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, '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': '7434879', 'n_tokens_mistral': 954, 'n_tokens_neox': 928, 'n_words': 146}