<commit_before>var gravity = 0.25;
var velocity = -5;
var position = 200;
var rotation = 0;

$(document).ready(function() {
   var updaterate = 1000.0 / 60.0 ; //60 times a second
   setInterval(mainloop, updaterate);
});

function mainloop() {
   var player = $("#player");
   velocity += gravity;
   position += velocity;
   
   //bounce (for testing)
   if(position > (player.parent().height() - player.height()))
      velocity = -velocity;
   
   //rotation
   //-10 and over should be 15 degrees rotated up
   //0 should be flat (obviously)
   //10 and over should be totally face down
   rotation = (velocity / 10) * 90;
   if(rotation > 90)
      rotation = 90;
   
   player.css({ rotate: rotation });
   player.css('top', position +'px');
}

$(document).mousedown(function(e) { 
   //click?
   if (e.button == 0)
      playerJump();
});

$(document).keydown(function(e){
   //space bar!
   if(e.keyCode == 32)
       playerJump();
});

function playerJump()
{
   velocity = -6;<commit_msg>Combined mobile and non mobile events<commit_after>var gravity = 0.25;
var velocity = -5;
var position = 200;
var rotation = 0;

$(document).ready(function() {
   var updaterate = 1000.0 / 60.0 ; //60 times a second
   setInterval(mainloop, updaterate);
});

function mainloop() {
   var player = $("#player");
   velocity += gravity;
   position += velocity;
   
   //bounce (for testing)
   if(position > (player.parent().height() - player.height()))
      velocity = -velocity;
   
   //rotation
   //-10 and over should be 15 degrees rotated up
   //0 should be flat (obviously)
   //10 and over should be totally face down
   rotation = (velocity / 10) * 90;
   if(rotation > 90)
      rotation = 90;
   
   player.css({ rotate: rotation });
   player.css('top', position +'px');
}

//Handle space bar
$(document).keydown(function(e){
   //space bar!
   if(e.keyCode == 32)
       playerJump();
});

//Handle mouse down OR touch start
if("ontouchstart" in window)
   $(document).on("touchstart", playerJump);
else
   $(document).on("mousedown", playerJump);

function playerJump()
{
   velocity = -6;
{'fraction_non_alphanumeric': 0.15874524714828897, 'fraction_numerical': 0.034695817490494295, 'mean_word_length': 2.9642184557438793, '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': '7404905', 'n_tokens_mistral': 741, 'n_tokens_neox': 673, 'n_words': 201}