// ****************************************************************************
//
// Logic 1: Opening/intro
//
// ****************************************************************************

#include "defines.txt"

if (new_room) {
 if (index == 0) {
   load.pic(room_no);
   draw.pic(room_no);
   discard.pic(room_no);
  //Initialization
  set(twinkie);
  set(grub);

  timer1_a = 0;
    load.sound(4);
    sound(4, sound_flag);

  }
  else {
    if (index == 1) {
        universe = 1;
        load.sound(4);
        sound(4, sound_flag);

        }
    if (index == 2) {
        universe = 92;
        animate.obj(o1); //DESIGNED
        load.view(218);
        set.view(o1,218);
        position(o1, 90,90);
        set.loop(o1, 0);
        set.priority(o1, 15);
        draw(o1);

        animate.obj(o2); //"BY"
        load.view(219);
        set.view(o2, 219);
        position(o2, 85, 100);
        set.loop(o2, 0);
        set.priority(o2, 15);
        draw(o2);

        animate.obj(o3); //ANDREW BAKER
        load.view(220);
        set.view(o3, 220);
        position(o3, 80, 111);
        set.priority(o3, 15);
        draw(o3);

        load.sound(6);
        sound(6, sound_flag);

        }

    if (index == 3) {
        universe = 93;



        load.sound(6);
        sound(6, sound_flag);
        }

 if (index == 4) {
       universe = 94;

       load.sound(42);
       sound(42, sound_flag);
       }

 if (index == 5) {
     universe = 2;
     }

    load.pic(universe);
    draw.pic(universe);
    discard.pic(universe);
    }




   set.horizon(37);
   status.line.off();
   prevent.input();
   program.control();

   reset(debug_active);

  show.pic();
  }

display(22,5, "Press <ENTER> to skip intro");

if (index == 1) {
    display(2,2, "          <<<<<WARNING>>>>>          ");
    display(3,2, "  <<<<<DON'T TRY THIS AT HOME>>>>>   ");
    display(4,2, "Voodoo Girl:  Queen of the Darned is ");
    display(5,2, "  an entirely fictional work.  The   ");
    display(6,2, "  \"magic\" she uses has very little,  ");
    display(7,2, "   if anything, to do with actual    ");
    display(8,2, "  Voodoo.  Real Voodoo was created   ");
    display(9,2, "   when colonists brought African    ");
   display(10,2, "  slaves to Haiti, mingling tribal   ");
   display(11,2, "  religions and medicinal practices  ");
   display(12,2, "   with 10,000 years of traditional  ");
   display(13,2, "  roots.  Voodoo Island represents a ");
   display(14,2, " best of all possible worlds version ");
   display(15,2, " version of Haiti.  I encourage any  ");
   display(16,2, " charity-minded people to research   ");
   display(17,2, " educational and medical programs in ");
   display(18,2, "Haiti that they could support, as the");
   display(19,2, "   real Haiti could use their help.  ");
    }

if (index == 2) {
    if (timer1_a == 20) {
        set.loop(o1, 1);
        }
    if (timer1_a == 40) {
        set.loop(o1, 2);
        }
    if (timer1_a == 60) {
        set.loop(o1, 0);
        timer1_a = 0;
        }
    timer1_a++;
    }

if (index == 3) {
    display(15,20, "    Music By    ");
   if (timer1_a == 1) {
    display(16,20, "  Andrew Baker  ");
    }
   if (timer1_a == 40) {
    display(16,20, "   Mick Couri   ");
    }
   if (timer1_a == 80) {
    display(16,20, " Jeremy Bobbit  ");
    }
   if (timer1_a == 120) {
    display(16,20, "   Beethoven    ");
    }
   if (timer1_a == 160) {
       timer1_a = 0;
       }
   timer1_a++;
    }

if (index == 4) {
    if (timer1_a == 1) {
      display(1,20, "    Play Testers   ");
      display(2,20, "   Nick Sonneveld  ");
      display(3,20, "   Raf Vermeulen   ");
      display(4,20, "                   ");
      display(5,20, "                   ");
    }
    if (timer1_a == 40) {
      display(1,20, "Research Assistants");
      display(2,20, "   Raf Vermeulen   ");
      display(3,20, "                   ");
      display(4,20, "                   ");
      display(5,20, "                   ");
      }
    if (timer1_a == 80) {
      display(1,20, " Special Thanks to ");
      display(2,20, " Stuart George (df)");
      display(3,20, "    Cris Cromer    ");
      display(4,20, "    Peter Kelly    ");
      display(5,20, "  Eric Fullerton   ");
      }
    if (timer1_a == 120) {
      display(1,20, "And the rest of the");
      display(2,20, "crew at Mega-Tokyo ");
      display(3,20, " (http://www.mega- ");
      display(4,20, "    tokyo.com)     ");
      display(5,20, "      Forum        ");
      }
    if (timer1_a == 160) {
      timer1_a = 0;
      }
    timer1_a++;
    }

if ((have.key() ||
     controller(key_joystick))) {
  set(menu_enabled);
  clear.lines(22, 24, 0);
  stop.motion(ego);
  reset(disable_game_functions);
  new.room(2);
}

if (sound_flag) {

    index++;
    timer1_a = 1;
    new.room(1);

    //discard.sound(4);
    }

return();