<commit_before>define(function(require){
    var scene = new THREE.Object3D;
    var camera = new THREE.PerspectiveCamera(65, 16 / 9, 0.1, 5000);
    var Timer = require("Timer");
    var particleSpeed = 0.05;

    var StarField = require("component/starfield");
    scene.add(StarField.create(33));

    var sparkTexture = THREE.ImageUtils.loadTexture("images/spark.png");

    var particleSystem = createParticleSystem();
    scene.add(particleSystem);

    camera.position.set(0, 10, 30);
    camera.lookAt(particleSystem.position);

    var timer = new Timer();
    var flash = 1;
    return{
        scene: scene,
        camera: camera,
        render: function(time){
            var passed = timer.getPassed(time);
            _.each(particleSystem.geometry.vertices, function(vert) {
                vert.add(vert.direction);
            });
            effectPass.uniforms.brightness.value = -0.2 * flash;
            flash = Math.max(0, flash - 0.1);
            scene.rotation.y += passed * 0.1;
            camera.position.z += passed;
            camera.position.y += passed * 5;
            camera.lookAt(particleSystem.position);
            // particleSystem.material.opacity = Math.max(0, particleSystem.material.opacity - passed * 0.1);
            particleSystem.material.size = Math.max(0, particleSystem.material.size - passed * 0.1);
        },
        init: function(){
            effectBloom.copyUniforms.opacity.value = 3;
        }

    };

    function createParticleSystem() {
        var particleMat = new THREE.ParticleSystemMaterial({
            color: 0xFFFFFF,
            size: 0.8,
            map: sparkTexture,
            transparent: true,<commit_msg>Add pretty colours to enemy explosion scene.<commit_after>define(function(require){
    var fromColor = new THREE.Color(0xffb400);
    var toColor = new THREE.Color(0x51c8ff);

    var scene = new THREE.Object3D;
    var camera = new THREE.PerspectiveCamera(65, 16 / 9, 0.1, 5000);
    var Timer = require("Timer");
    var particleSpeed = 0.05;

    var StarField = require("component/starfield");
    scene.add(StarField.create(33));

    var sparkTexture = THREE.ImageUtils.loadTexture("images/spark.png");

    var particleSystem = createParticleSystem();
    scene.add(particleSystem);

    camera.position.set(0, 10, 30);
    camera.lookAt(particleSystem.position);

    var timer = new Timer();
    var flash = 1;
    return{
        scene: scene,
        camera: camera,
        render: function(time){
            var passed = timer.getPassed(time);
            _.each(particleSystem.geometry.vertices, function(vert) {
                vert.add(vert.direction);
            });
            effectPass.uniforms.brightness.value = -0.2 * flash;
            flash = Math.max(0, flash - 0.1);
            scene.rotation.y += passed * 0.1;
            camera.position.z += passed;
            camera.position.y += passed * 5;
            camera.lookAt(particleSystem.position);
            // particleSystem.material.opacity = Math.max(0, particleSystem.material.opacity - passed * 0.1);
            particleSystem.material.size = Math.max(0, particleSystem.material.size - passed * 0.3);

            var colorPos = Math.min(1, timer.getTime(time) * 0.1);
            particleSystem.material.color.setRGB(
                Math.max(0, fromColor.r - colorPos) + Math.max(0, toColor.r - (1 - colorPos)),
                Math.max(0, fromColor.g - colorPos) + Math.max(0, toColor.g - (1 - colorPos)),
                Math.max(0, fromColor.b - colorPos) + Math.max(0, toColor.b - (1 - colorPos))
            );

        },
        init: function(){
            effectBloom.copyUniforms.opacity.value = 3;
        }

    };

    function createParticleSystem() {
        var particleMat = new THREE.ParticleSystemMaterial({
            color: 0xFFFFFF,
            size: 2,
            map: sparkTexture,
            transparent: true,
{'fraction_non_alphanumeric': 0.12455425369332654, 'fraction_numerical': 0.025725929699439633, 'mean_word_length': 2.169491525423729, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4995074', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1119, 'n_words': 236}