home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / correjoaninha.swf / scripts / frame_4 / DoAction.as
Encoding:
Text File  |  2008-03-07  |  1.9 KB  |  97 lines

  1. function iniciaContagem()
  2. {
  3.    clearInterval(intvCont);
  4.    intvCont = setInterval(function()
  5.    {
  6.       tempo--;
  7.       if(tempo == 0)
  8.       {
  9.          fim = true;
  10.          stopDrag();
  11.          clearInterval(intvCont);
  12.          principal.gotoAndStop("perde");
  13.       }
  14.    }
  15.    ,500);
  16.    return undefined;
  17. }
  18. function fimDeJogo(vence)
  19. {
  20.    fim = true;
  21.    clearInterval(intvCont);
  22.    if(vence)
  23.    {
  24.       intvCont = setInterval(function()
  25.       {
  26.          clearInterval(intvCont);
  27.          gotoAndStop("vence");
  28.       }
  29.       ,500);
  30.       return undefined;
  31.    }
  32.    vidas--;
  33.    intvCont = setInterval(function()
  34.    {
  35.       clearInterval(intvCont);
  36.       vidas != 0 ? continuaFase(false) : (gotoAndStop("perde"), ┬º┬ºpush(undefined), undefined);
  37.    }
  38.    ,500);
  39.    return undefined;
  40. }
  41. function fimDeFase()
  42. {
  43.    stopDrag();
  44.    clearInterval(intvCont);
  45.    fim = true;
  46.    okChegada = true;
  47.    principal.gotoAndStop(4);
  48.    pontos += tempo;
  49.    pontos += barraDeEnergia._width;
  50.    if(fase == labirintos._totalframes)
  51.    {
  52.       fimDeJogo(true);
  53.       return undefined;
  54.    }
  55.    painel.play();
  56.    return undefined;
  57. }
  58. function continuaFase(nf)
  59. {
  60.    principal._x = pX;
  61.    principal._y = pY;
  62.    labirintos.labirinto.gotoAndStop(1);
  63.    principal.gotoAndStop(1);
  64.    barraDeEnergia._width = 100;
  65.    if(nf)
  66.    {
  67.       fase++;
  68.       labirintos.nextFrame();
  69.    }
  70.    tempo = tempoTotal;
  71.    contando = false;
  72.    okChegada = false;
  73.    clearInterval(intvCont2);
  74.    intvCont2 = setInterval(function()
  75.    {
  76.       clearInterval(intvCont2);
  77.       fim = false;
  78.    }
  79.    ,500);
  80.    return undefined;
  81. }
  82. stop();
  83. var pontos = 0;
  84. verPainel = false;
  85. var dragMouse = false;
  86. var contando = false;
  87. var okChegada = false;
  88. var fim = false;
  89. var bMargem = 20;
  90. var tempoTotal = 300;
  91. var tempo = tempoTotal;
  92. var fase = 1;
  93. var vidas = 5;
  94. var enDec = 2;
  95. var pX = 45;
  96. var pY = 45;
  97.