<commit_before>
function updateGameArea() {
      var x, y;
        for (i = 0; i < myObstacles.length; i += 1) {
            if (myGamePiece.crashWith(myObstacles[i])) {
                myGameArea.stop();
                return;
            } 
        }
        myGameArea.clear();
        myGameArea.frameNo += 1;
        if (myGameArea.frameNo == 1 || everyinterval(150)) {
            x = myGameArea.canvas.width;
            minHeight = 20;
            maxHeight = 200;
            height = Math.floor(Math.random()*(maxHeight-minHeight+1)+minHeight);
            minGap = 50;
            maxGap = 200;
            gap = Math.floor(Math.random()*(maxGap-minGap+1)+minGap);
            myObstacles.push(new component(10, height, "green", x, 0));
            myObstacles.push(new component(10, x - height - gap, "green", x, height + gap));
        }
        for (i = 0; i < myObstacles.length; i += 1) {
            myObstacles[i].x += -1;
            myObstacles[i].update();
        }
       // myObstacle.x += -1;
        myGamePiece.speedX = 0;
        myGamePiece.speedY = 0;
        if (myGameArea.keys && myGameArea.keys[37]) {myGamePiece.speedX = -1; }
        if (myGameArea.keys && myGameArea.keys[39]) {myGamePiece.speedX = 1; }
        if (myGameArea.keys && myGameArea.keys[38]) {myGamePiece.speedY = -1; }
        if (myGameArea.keys && myGameArea.keys[40]) {myGamePiece.speedY = 1; }
        
        /*// for touch control
        if (myGameArea.touchX && myGameArea.touchY) {
            myGamePiece.x = myGameArea.x;
            myGamePiece.y = myGameArea.y; 
        }*/
        /*
        //mouse controller
        if (myGameArea.x && myGameArea.y) {
            myGamePiece.x = myGameArea.x;
            myGamePiece.y = myGameArea.y; 
        }
        */
        score=myObstacles.length/2-4;
        if(score<0){
            score=0;
        }else{
            score=myObstacles.length/2-3;
        }
        scr=i/2-3;//same as score
        myScore.text="SCORE: " + score;
        myScore.update();
        myGamePiece.newPos();
        myGamePiece.update(); 
}<commit_msg>update sounds and controls<commit_after>
function updateGameArea() {
      var x, y;
        for (i = 0; i < myObstacles.length; i += 1) {
            if (myGamePiece.crashWith(myObstacles[i])) {
                myGameArea.stop();
                return;
            } 
        }
        myGameArea.clear();
        myGameArea.frameNo += 1;
        if (myGameArea.frameNo == 1 || everyinterval(150)) {
            x = myGameArea.canvas.width;
            minHeight = 20;
            maxHeight = 200;
            height = Math.floor(Math.random()*(maxHeight-minHeight+1)+minHeight);
            minGap = 50;
            maxGap = 200;
            gap = Math.floor(Math.random()*(maxGap-minGap+1)+minGap);
            myObstacles.push(new component(10, height, "green", x, 0));
            myObstacles.push(new component(10, x - height - gap, "green", x, height + gap));
        }
        for (i = 0; i < myObstacles.length; i += 1) {
            myObstacles[i].x += -1;
            myObstacles[i].update();
        }
        myGamePiece.speedX = 0;
        myGamePiece.speedY = 0;
        score=myObstacles.length/2-4;
        if(score<0){
            score=0;
        }else{
            score=myObstacles.length/2-3;
        }
        scr=i/2-3;//same as score
        myScore.text="SCORE: " + score;
        myScore.update();
        myGamePiece.newPos();
        myGamePiece.update(); 
}
{'fraction_non_alphanumeric': 0.14126074498567334, 'fraction_numerical': 0.02492836676217765, 'mean_word_length': 1.6446969696969698, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2790718', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1164, 'n_words': 204}