<commit_before>function random(seed) {
    var x = Math.sin(seed) * 10000;
    return x - Math.floor(x);
}

function Player(x, y) {
    this.x = x;
    this.y = y;
    this.rotation = 0;
    this.bitmap = new Bitmap('assets/player.png', 16, 16, 4);
    this.animationTimer = 1/24;
    this.shootTimer = 0.25;
    this.shots = 50;
    this.health = 100;
    this.CIRCLE = Math.PI * 2;
    this.type = 'player';
    this.shadow = new Shadow(x, y, new Bitmap('assets/shadow_player.png', 16, 16, 2), this, 3, 3);

    this.createTiles(0, 0);
    backgroundLayer.push(this.shadow);
}

Player.prototype.update = function(controls, deltaT) {
    if(controls.left) {
        this.rotation = (this.rotation - deltaT * 5) % this.CIRCLE;
    }
    if(controls.right) {
        this.rotation = (this.rotation + deltaT * 5) % this.CIRCLE;
    }

    if(controls.up) {
        this.move(40 * deltaT);
    }
    if(controls.down) {
        this.move(-40 * deltaT);
    }

    if(controls.shoot) {
        this.shoot(deltaT);
    }

    if(this.animationTimer <= 0.0) {
        this.animationTimer += 1/24;

        this.bitmap.currentFrame = (this.bitmap.currentFrame + 1) % this.bitmap.numberOfFrames;<commit_msg>Stop rendering player when he's dead<commit_after>function random(seed) {
    var x = Math.sin(seed) * 10000;
    return x - Math.floor(x);
}

function Player(x, y) {
    this.x = x;
    this.y = y;
    this.rotation = 0;
    this.bitmap = new Bitmap('assets/player.png', 16, 16, 4);
    this.animationTimer = 1/24;
    this.shootTimer = 0.25;
    this.shots = 50;
    this.health = 100;
    this.CIRCLE = Math.PI * 2;
    this.type = 'player';
    this.shadow = new Shadow(x, y, new Bitmap('assets/shadow_player.png', 16, 16, 2), this, 3, 3);

    this.createTiles(0, 0);
    backgroundLayer.push(this.shadow);
}

Player.prototype.update = function(controls, deltaT) {
    if(this.health <= 0) {
        backgroundLayer.splice(backgroundLayer.indexOf(this.shadow), 1);
        entities.splice(entities.indexOf(this), 1);
    }

    if(controls.left) {
        this.rotation = (this.rotation - deltaT * 5) % this.CIRCLE;
    }
    if(controls.right) {
        this.rotation = (this.rotation + deltaT * 5) % this.CIRCLE;
    }

    if(controls.up) {
        this.move(40 * deltaT);
    }
    if(controls.down) {
        this.move(-40 * deltaT);
    }

    if(controls.shoot) {
        this.shoot(deltaT);
    }

    if(this.animationTimer <= 0.0) {
        this.animationTimer += 1/24;

        this.bitmap.currentFrame = (this.bitmap.currentFrame + 1) % this.bitmap.numberOfFrames;
{'fraction_non_alphanumeric': 0.15542635658914727, 'fraction_numerical': 0.03527131782945737, 'mean_word_length': 2.4784366576819408, 'pattern_counts': {'":': 0, '<': 6, '<?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': '1916577', 'n_tokens_mistral': 1004, 'n_tokens_neox': 911, 'n_words': 176}