<commit_before>define('Enemy',

['Sprite', 'vent', 'util'],

function( Sprite, vent, util ){

    'use strict';

    var proto;

    function Enemy(){
        Sprite.apply(this, arguments);
        this.fillStyle = util.randomColor();
        this.size = 30;
        this.isCreated = false;
        this.physics = {
            speed: 2,
            friction: 2,
            velocity: 0,
            velocityGoal: Math.random() * (2 - 1) + 1
        };
        this.position = {
            x: Math.random() * this.canvas.width,
            y: 0 - this.size
        };
    }

    proto = Enemy.prototype = Object.create(Sprite.prototype);


    proto.create = function(){
        Sprite.prototype.create.call(this);
        return this;
    };


    proto.render = function(){
        if ( this.destroyed ) {
            return;
        }

        this.ctx.shadowOffsetX = 0;
        this.ctx.shadowOffsetY = 0;
        this.ctx.shadowBlur = 40;
        this.ctx.shadowColor = 'rgba(241, 241, 241, 1)';

        this.ctx.fillStyle = 'rgba(241, 241, 241, 1)';
        this.ctx.beginPath();
        this.ctx.arc(
          this.position.x, this.position.y, this.size, 0, 2 * Math.PI, false
        );
        this.ctx.fill();
    };


    proto.update = function(){
        if ( this.destroyed ) {
            return;
        }

        this.physics.velocity = util.approach(
          this.physics.velocityGoal,
          this.physics.velocity,
          this.physics.friction
        );

        if ( this.position.y + this.physics.velocity >
          this.canvas.height + this.size ) {
            this.destroy();
        } else {
            this.position.y = this.position.y + this.physics.velocity;
        }
    };
<commit_msg>working on enemy presentation<commit_after>define('Enemy',

['Sprite', 'vent', 'util'],

function( Sprite, vent, util ){

    'use strict';

    var proto;

    function Enemy(){
        Sprite.apply(this, arguments);
        this.fillStyle = util.randomColor();
        this.size = 30;
        this.isCreated = false;
        this.physics = {
            speed: 2,
            friction: 2,
            velocity: 0,
            velocityGoal: Math.random() * (2 - 1) + 1
        };
        this.orbiter = {
            physics: {
                friction: 2,
                velocity: 1,
                velocityGoal: Math.random() * (2 - 1) + 1
            },
            current: {
                x: 0,
                y: 0
            }
        };
        this.orbitAt = 0;
        this.inc = 0.2;
        this.position = {
            x: Math.random() * this.canvas.width,
            y: 0 - this.size
        };
    }

    proto = Enemy.prototype = Object.create(Sprite.prototype);


    proto.create = function(){
        Sprite.prototype.create.call(this);
        return this;
    };


    proto.render = function(){
        if ( this.destroyed ) {
            return;
        }

        var inc = 0.3,
            curr = inc,
            alpha = 0.9;


        // Render primary body
        this.ctx.shadowOffsetX = 0;
        this.ctx.shadowOffsetY = 0;
        this.ctx.shadowBlur = 40;
        this.ctx.shadowColor = 'rgba(241, 241, 241, 1)';

        this.ctx.fillStyle = 'rgba(241, 241, 241, 1)';
        this.ctx.beginPath();
        this.ctx.arc(
          this.position.x, this.position.y, this.size, 0, 2 * Math.PI, false
        );
        this.ctx.fill();


        // Render orbiter
        this.orbitAt += this.inc;

        this.ctx.shadowBlur = 0;
        this.ctx.fillStyle = 'rgba(255, 0, 0, 1)';
        this.ctx.beginPath();
        this.ctx.arc(
          this.position.x + (this.size + 5) * Math.cos(this.orbitAt),
          this.position.y + (this.size + 5) * Math.sin(this.orbitAt),
          5, 0, 2 * Math.PI, false
        );
        this.ctx.fill();

        // Render trail
        for (var i = 0; i < 5; i++) {
            this.ctx.fillStyle = 'rgba(230, 0, 0, ' + alpha + ')';
            this.ctx.beginPath();
            this.ctx.arc(
              this.position.x + (this.size + 5) * Math.cos(this.orbitAt-curr),
              this.position.y + (this.size + 5) * Math.sin(this.orbitAt-curr),
              5, 0, 2 * Math.PI, false
            );
            this.ctx.fill();
            curr += inc;
            alpha -= inc + inc*0.5;
        }
    };


    proto.update = function(){
        if ( this.destroyed ) {
            return;
        }

        this.physics.velocity = util.approach(
          this.physics.velocityGoal,
          this.physics.velocity,
          this.physics.friction
        );

        if ( this.position.y + this.physics.velocity >
          this.canvas.height + this.size ) {
            this.destroy();
        } else {
            this.position.y = this.position.y + this.physics.velocity;
        }
    };

{'fraction_non_alphanumeric': 0.13924050632911392, 'fraction_numerical': 0.022826312512969495, 'mean_word_length': 1.4015944195316392, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3355623', 'n_tokens_mistral': 1626, 'n_tokens_neox': 1484, 'n_words': 295}