let MyLogo = new Logo();
let MyTornado = new Tornado(80);
let MyTornado2 = new Tornado(80);
let MyCubes = new Cubes();
let Mylogointro = new logointro();
let Mylogointro2 = new logointro();
let Mytentacule = new tentacule();
let MyParticle = new Particle();
let Mytunnel = new tunnel();
let Myhead = new head();
let Myflash = new flash();
let Mytete = new crt();

let tl_MyLogo = new TimeLine(0, 12318);
let tl_Myflash = new TimeLine(12318,13300);
let tl_MyParticle = new TimeLine(13300, 24235);
let tl_MyTornado = new TimeLine(24235,39114);
let tl_Mytunnel = new TimeLine(39114,55553);
let tl_MyCubes = new TimeLine(55553,77064);
let tl_MyTentacle = new TimeLine(77064,92253);
let tl_MyTornado2 = new TimeLine(92253,106472);
let tl_Mylogointro2 = new TimeLine(92253,106472);
let tl_Myhead = new TimeLine(106472,116488);
let tl_Mylogointro = new TimeLine(116488,125460);
let tl_Mytete = new TimeLine(125460,131224);

function preload()
{
    soundFormats('mp3', 'ogg');
    mySound = loadSound('assets/revision-track.mp3');    
    MyLogo.init();
    MyTornado.init();
    MyCubes.init();
    Mylogointro.init();
    Mylogointro2.init();
    Mytentacule.init();
    MyTornado2.init();
    Myhead.init();
    Mytete.init();
    MyParticle.init();
}
function setup() 
{
  createCanvas(800, 800, WEBGL); 
  userStartAudio()
  mySound.play();
}

function draw() 
{
  background(0);
  
  if (tl_Mylogointro.apply()) Mylogointro.FX();
  if (tl_Myflash.apply()) Myflash.FX();
  if (tl_Mylogointro2.apply()) Mylogointro.FX();
  if (tl_MyTornado.apply()) MyTornado.show(15);
  if (tl_MyTornado2.apply()) MyTornado2.show(15);
  if (tl_MyCubes.apply()) MyCubes.FX();
  if (tl_MyLogo.apply()) MyLogo.FX();
  if (tl_MyParticle.apply()) MyParticle.FX();
  if (tl_MyTentacle.apply()) Mytentacule.FX();
  if (tl_Mytunnel.apply()) Mytunnel.FX();
  if (tl_Myhead.apply()) Myhead.FX();
  if (tl_Myflash.apply()) Myflash.FX();
  if (tl_Mytete.apply()) Mytete.FX();    
}