<commit_before>var mobile_found = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);

if (mobile_found) {
    console.log('MOBILE');
} else {
    console.log('NOT MOBILE');
}

var libsToLoad = [
    "jquery",
    'phaser'
];

// add cordova when using a mobile device
if(mobile_found) libsToLoad.push("../cordova");

require(libsToLoad, function(
    $
    // ,Phaser
){
    // Initialize Phaser, and creates a 400x490px game
    var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div');
    var game_state = {};

    // Creates a new 'main' state that will contain the game
    game_state.main = function() { };
    game_state.main.prototype = {

        // Function called first to load all the assets
        preload: function() {
            // Change the background color of the game
            this.game.stage.backgroundColor = '#71c5cf';

            // Load the bird sprite
            this.game.load.image('bird', 'img/bird.svg');

            // Load the pipe sprite
            this.game.load.image('pipe', 'img/pipe.png');
        },

        // Fuction called after 'preload' to setup the game
        create: function() {
            this.game.physics.startSystem(Phaser.Physics.ARCADE);

            // Display the bird on the screen
            this.bird = this.game.add.sprite(100, 245, 'bird');

            this.bird.anchor.setTo(-0.2, 0.5);

            this.game.physics.arcade.gravity.y = 100;
            this.game.physics.enable(this.bird, Phaser.Physics.ARCADE);

            // Add gravity to the bird to make it fall
            // this.bird.gravity = new Phaser.Point(0, 1200);

            // Call the 'jump' function when the spacekey is hit
            // var space_key = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
            // space_key.onDown.add(this.jump, this);

            var self = this;
            this.game.input.onTap.add(function(e){
                console.log('tapped');
                self.jump();
            }, this);

            // Create a group of 20 pipes
            this.pipes = game.add.group();
            this.pipes.createMultiple(20, 'pipe');

            // Timer that calls 'add_row_of_pipes' ever 1.5 seconds
            this.timer = this.game.time.events.loop(1500, this.add_row_of_pipes, this);<commit_msg>fixing gravity<commit_after>var mobile_found = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);

if (mobile_found) {
    console.log('MOBILE');
} else {
    console.log('NOT MOBILE');
}

var libsToLoad = [
    "jquery",
    'phaser'
];

// add cordova when using a mobile device
if(mobile_found) libsToLoad.push("../cordova");

require(libsToLoad, function(
    $
    // ,Phaser
){
    // Initialize Phaser, and creates a 400x490px game
    var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div');
    var game_state = {};

    // Creates a new 'main' state that will contain the game
    game_state.main = function() { };
    game_state.main.prototype = {

        // Function called first to load all the assets
        preload: function() {
            // Change the background color of the game
            this.game.stage.backgroundColor = '#71c5cf';

            // Load the bird sprite
            this.game.load.image('bird', 'img/bird.svg');

            // Load the pipe sprite
            this.game.load.image('pipe', 'img/pipe.png');
        },

        // Fuction called after 'preload' to setup the game
        create: function() {
            this.game.physics.startSystem(Phaser.Physics.ARCADE);

            // Display the bird on the screen
            this.bird = this.game.add.sprite(100, 245, 'bird');

            this.bird.anchor.setTo(-0.2, 0.5);

            this.game.physics.arcade.gravity.y = 400;
            this.game.physics.enable(this.bird, Phaser.Physics.ARCADE);

            // Add gravity to the bird to make it fall
            // this.bird.gravity = new Phaser.Point(0, 1200);

            // Call the 'jump' function when the spacekey is hit
            // var space_key = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
            // space_key.onDown.add(this.jump, this);

            var self = this;
            this.game.input.onTap.add(function(e){
                console.log('tapped');
                self.jump();
            }, this);

            // Create a group of 20 pipes
            this.pipes = game.add.group();
            this.pipes.createMultiple(30, 'pipe');

            // Timer that calls 'add_row_of_pipes' ever 1.5 seconds
            this.timer = this.game.time.events.loop(1500, this.add_row_of_pipes, this);
{'fraction_non_alphanumeric': 0.12823252831801668, 'fraction_numerical': 0.01837999572558239, 'mean_word_length': 2.038961038961039, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3341200', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1416, 'n_words': 336}