<commit_before>var Ghost = (function(){
    function Ghost(game, x, y){
        properties = {
            group: 'ghosts',
            spritesheet: 'ghost'
        };

        Prefab.call(this, game, name, {x:x, y:y}, properties);

        this.speed = 2;
        this.game = game;
        this.timer = 1000;

        this.game.physics.enable(this);
        this.anchor.set(0.5);

        this.setAnimation();

        this.moves = ['moveUp','moveDown','moveLeft','moveRight'];
        this.lastMove = null;
    };

    Ghost.prototype = Object.create(Phaser.Sprite.prototype);
    Ghost.prototype.constructor = Ghost;

    Ghost.prototype.setAnimation = function() {
        this.animations.add('down', [0, 1, 2], this.framesPerSecond, true);
        this.animations.add('right', [3, 4, 5], this.framesPerSecond, true);
        this.animations.add('up', [6, 7, 8], this.framesPerSecond, true);
        this.animations.add('left', [3, 4, 5], this.framesPerSecond, true);
    };

    Ghost.prototype.update = function(){
        Phaser.Sprite.prototype.update.call(this);
        var moveIn = this.lastMove;
        if (!this.lastMove || Math.random() > 0.9) {
            moveIn = this.moves[Math.floor(Math.random() * 10) % 4];
        }
        this[moveIn]();
        this.lastMove = moveIn;
    };

    Ghost.prototype.moveUp = function(){
        this.y -= this.speed;
        this.animations.play('up');
    };
    Ghost.prototype.moveDown = function(){
        this.y += this.speed;
        this.animations.play('down');
    };
    Ghost.prototype.moveLeft = function(){<commit_msg>Added transparency + slower movement to ghosts<commit_after>var Ghost = (function(){
    function Ghost(game, x, y){
        properties = {
            group: 'ghosts',
            spritesheet: 'ghost'
        };

        Prefab.call(this, game, name, {x:x, y:y}, properties);

        this.speed = 0.5;
        this.game = game;
        this.timer = 1000;
        this.framesPerSecond = 3;

        this.game.physics.enable(this);
        this.anchor.set(0.5);
        this.alpha = 0.5;

        this.setAnimation();

        this.moves = ['moveUp','moveDown','moveLeft','moveRight'];
        this.lastMove = null;
    };

    Ghost.prototype = Object.create(Phaser.Sprite.prototype);
    Ghost.prototype.constructor = Ghost;

    Ghost.prototype.setAnimation = function() {
        this.animations.add('down', [0, 1, 2], this.framesPerSecond, true);
        this.animations.add('right', [3, 4, 5], this.framesPerSecond, true);
        this.animations.add('up', [6, 7, 8], this.framesPerSecond, true);
        this.animations.add('left', [3, 4, 5], this.framesPerSecond, true);
    };

    Ghost.prototype.update = function(){
        Phaser.Sprite.prototype.update.call(this);
        var moveIn = this.lastMove;
        if (!this.lastMove || Math.random() > 0.98) {
            moveIn = this.moves[Math.floor(Math.random() * 10) % 4];
        }
        this[moveIn]();
        this.lastMove = moveIn;
    };

    Ghost.prototype.moveUp = function(){
        this.y -= this.speed;
        this.animations.play('up');
    };
    Ghost.prototype.moveDown = function(){
        this.y += this.speed;
        this.animations.play('down');
    };
    Ghost.prototype.moveLeft = function(){
{'fraction_non_alphanumeric': 0.1620879120879121, 'fraction_numerical': 0.01617826617826618, 'mean_word_length': 2.2934673366834173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4393216', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1030, 'n_words': 188}