///Class tornado/////

class Tornado
{
    constructor(length = 80)
    {
        this.length = length;
    }
  
    init ()
    {
        this.img = loadImage('assets/abstract-blue-color-neon-dots.jpg');
    }
  
    show ()
    {

    if (frameCount % 180 === 0) 
    {
      this.delta *= -1;
      this.deltat *= -2;
    }

    translate(0,-400,0);
    blendMode(BLEND);

    for (let i = 0; i <= this.length; i++) 
    { 
        push();

        rotateY(millis() /9000*i/3);  
        translate(0,12*i,0);
        fill(0+(i*4),0+(i*1),60);
        stroke(0);
        box(300,9,100);
        
        translate(150,0,0)
        noStroke();
        fill(0,0+(i*5),0+(i*5));
        box(15);
        
        translate(110,0,0)
        noStroke();
        fill(0,0+(i*7),0+(i*5));
        box(8);  
        
        translate(130,0,0)
        noStroke();
        fill(0,0+(i*7),0+(i*5));
        box(5);  

        pop();

    }

    texture(this.img)
    rotateZ(millis() /3000)
    box(2000)
  }
}