//////////////////////////
//PARTICLES            //
////////////////////////
function part16() {
    this.vbl = 0 ;
    this.canvaspart;
    this.initdone = 0 ;

    var mycanvastemp;
    var hmd_ch_part = 0;
    var hmd_vbl_particle = 0;
    var hmd_xf1 = 0;
    var hmd_yf1 = 0;
    var hmd_xf2 = 0;
    var hmd_yf2 = 0;
    var hmd_ch_part = 0;

    var up_st  = 0.25;
    var up_st2 = 1.5;
    var up_st3 = 1.5;
    var up_st4 = 0.25;

    up_st = 6 ;
    up_st2 = 35 ;
    up_st3 = 27 ;
    up_st4 = 4 ;


    function hmd_drawline(dest) {
        var time = Date.now() / 800;
        var mix = Math.sin(time);
        for (var xy, t=0; t<Math.PI*2; t+=Math.PI/52) {
            xy = mixf(f1(t,hmd_xf1,hmd_yf1), f2(t,hmd_xf2,hmd_yf2), mix);

            var x = xy.x ; 
            var y = xy.y ;

   particle[0].draw(dest,4*x,4*-y);particle[0].draw(dest,4*-x,4*y);particle[0].draw(dest,4*-y,4*x);particle[0].draw(dest,4*y,4*-x);particle[1].draw(dest,6*x,6*-y);particle[1].draw(dest,6*-x,6*y);particle[1].draw(dest,6*-y,6*x);particle[1].draw(dest,6*y,6*-x);particle[2].draw(dest,8*x,8*-y);particle[2].draw(dest,8*-x,8*y);particle[2].draw(dest,8*-y,8*x);particle[2].draw(dest,8*y,8*-x);particle[3].draw(dest,10*x,10*-y);particle[3].draw(dest,10*-x,10*y);particle[3].draw(dest,10*-y,10*x);
particle[3].draw(dest,10*y,10*-x);particle[4].draw(dest,12*x,12*-y);particle[4].draw(dest,12*-x,12*y);particle[4].draw(dest,12*-y,12*x);particle[4].draw(dest,12*y,12*-x);particle[5].draw(dest,14*x,14*-y);particle[5].draw(dest,14*-x,14*y);particle[5].draw(dest,14*-y,14*x);particle[5].draw(dest,14*y,14*-x);particle[6].draw(dest,16*x,16*-y);particle[6].draw(dest,16*-x,16*y);particle[6].draw(dest,16*-y,16*x);particle[6].draw(dest,16*y,16*-x);particle[7].draw(dest,18*x,18*-y);
particle[7].draw(dest,18*-x,18*y);particle[7].draw(dest,18*-y,18*x);particle[7].draw(dest,18*y,18*-x);
        }

    var tmp=Math.cos(hmd_vbl_particle);hmd_xf1=up_st+(tmp+18)*tmp;hmd_yf1=up_st2+(tmp+12)*tmp;hmd_xf2=up_st3+(tmp+8)*tmp;hmd_yf2=up_st4+(tmp+4)*tmp;hmd_vbl_particle+=0.04;up_st+=0.001;up_st2+=0.005;up_st3-=0.005;up_st4-=0.001;
    }

   function mixf(a,b,c){return{x:a.x*c+b.x*(1-c),y:a.y*c+b.y*(1-c)}}function f1(a,b,c){return{x:b*Math.cos(a)-6*Math.cos(11/6*a),y:c*Math.sin(a)-6*Math.sin(11/6*a)}}function f2(a,b,c){return{x:b*Math.cos(3*a),y:3*c*Math.sin(a)}}this.init=function(a){mycanvastemp=new canvas(a.width,a.height);this.initdone=1};
this.render=function(a){0==this.initdone&&(this.canvaspart=new canvas(600,400),this.init(this.canvaspart));this.canvaspart.clear();mycanvastemp.fill("rgba(0,0,0,0.2)");hmd_drawline(mycanvastemp);var b=Date.now()/800,b=Math.sin(b);mycanvastemp.draw(this.canvaspart,300,200,1,0+Date.now()/1600%(30*Math.PI)*(4-b));mycanvastemp.draw(this.canvaspart,300,200,1,180+Date.now()/1600%(30*Math.PI)*(4-b));mycanvastemp.draw(this.canvaspart,300,200,1,90+Date.now()/1600%(30*Math.PI)*(4-b));mycanvastemp.draw(this.canvaspart,
300,200,1,-90+Date.now()/1600%(30*Math.PI)*(4-b));this.canvaspart.draw(a,60,88);100>this.vbl&&mycanvasblack.draw(a,60,88,1-this.vbl/100);this.vbl>intro_parts[part_running].part_duration-100&&mycanvasblack.draw(a,60,88,1-(intro_parts[part_running].part_duration-this.vbl)/100);this.vbl++};

    return this ;
}

///////////////
//END PART16//
/////////////
