<commit_before>require (["pixi",   "keydrown"],
function ( PIXI,     kd) {

var width = 600;
var height = 400;
var xpadding = 20;
var moveDistance = 5;

var ballMoveX = -3;
var ballMoveY = 2;

function stageMap() {
    // create a new instance of a pixi stage
    var stage = new PIXI.Stage(0x66FF99);

    // create a new renderer instance
    var renderer = PIXI.autoDetectRenderer(width, height);

    // add the renderer view element to the DOM
    document.body.appendChild(renderer.view);

    return [stage, renderer];
}

function stageImage(file, x, y) {
    // create a texture from an image path
    var texture = PIXI.Texture.fromImage(file);
    //create a new Sprite using the texture
    var image = new PIXI.Sprite(texture);

    // these are the default values
    image.anchor.x = 0;
    image.anchor.y = 0;

    image.position.x = x;
    image.position.y = y;

    stage.addChild(image);
    return image;
}

function move (what, amount) {
    var edgeTop = what.position.y;
    var edgeBot = what.position.y + what.width;

    if (edgeTop > 0 || edgeBot < height) {
        what.position.y += amount;
    }
    else if (edgeTop <= 0 && amount > 0) {
        what.position.y += amount;
    }
    else if (edgeBot >= width && amount < 0) {
        what.position.y += amount;
    }

}

function moveBall () {
    // x-coord of right side of ball
    var br = ball.position.x + ball.width;

    if (ball.position.x + ballMoveX <= player.position.x + player.width) {
        if (ball.position.y >= player.position.y) {
            if (ball.position.y + ball.width <= player.position.y + player.height) {
                ball.position.x = player.position.x + player.width;
                ballMoveX = -ballMoveX;
            }
        }
    }
    if (br + ballMoveX >= enemy.position.x) {
        if (ball.position.y >= enemy.position.y) {
            if (ball.position.y + ball.width <= enemy.position.y + enemy.height) {
                ball.position.x = enemy.position.x - ball.width;
                ballMoveX = -ballMoveX;
            }
        }
    }
    else if (ball.position.y <= 0 || ball.position.y >= height - ball.width) {<commit_msg>Correct paddle limit height code<commit_after>require (["pixi",   "keydrown"],
function ( PIXI,     kd) {

var width = 600;
var height = 400;
var xpadding = 20;
var moveDistance = 5;

var ballMoveX = -3;
var ballMoveY = 2;

function stageMap() {
    // create a new instance of a pixi stage
    var stage = new PIXI.Stage(0x66FF99);

    // create a new renderer instance
    var renderer = PIXI.autoDetectRenderer(width, height);

    // add the renderer view element to the DOM
    document.body.appendChild(renderer.view);

    return [stage, renderer];
}

function stageImage(file, x, y) {
    // create a texture from an image path
    var texture = PIXI.Texture.fromImage(file);
    //create a new Sprite using the texture
    var image = new PIXI.Sprite(texture);

    // these are the default values
    image.anchor.x = 0;
    image.anchor.y = 0;

    image.position.x = x;
    image.position.y = y;

    stage.addChild(image);
    return image;
}

function move (what, amount) {
    var y = what.position.y;

    // if position of paddle is at top or bottom
    if ((y <= 0 && amount < 0) || (y + what.height >= height && amount > 0)) {
        amount = 0;
    }

    what.position.y += amount;
}

function moveBall () {
    // x-coord of right side of ball
    var br = ball.position.x + ball.width;

    if (ball.position.x + ballMoveX <= player.position.x + player.width) {
        if (ball.position.y >= player.position.y) {
            if (ball.position.y + ball.width <= player.position.y + player.height) {
                ball.position.x = player.position.x + player.width;
                ballMoveX = -ballMoveX;
            }
        }
    }
    if (br + ballMoveX >= enemy.position.x) {
        if (ball.position.y >= enemy.position.y) {
            if (ball.position.y + ball.width <= enemy.position.y + enemy.height) {
                ball.position.x = enemy.position.x - ball.width;
                ballMoveX = -ballMoveX;
            }
        }
    }
    else if (ball.position.y <= 0 || ball.position.y >= height - ball.width) {
{'fraction_non_alphanumeric': 0.12855787476280836, 'fraction_numerical': 0.010910815939278937, 'mean_word_length': 2.142324888226528, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '1496033', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1344, 'n_words': 376}