home *** CD-ROM | disk | FTP | other *** search
/ Champak 122 / Vol 122.iso / games / need_for.swf / scripts / frame_13 / DoAction.as
Encoding:
Text File  |  2011-01-06  |  1.2 KB  |  69 lines

  1. if(!pauseflag)
  2. {
  3.    frameN += 1;
  4.    if(frameN % 12 == 0)
  5.    {
  6.       tim -= 1;
  7.       if(tim < 10)
  8.       {
  9.          tick_Sound.start();
  10.       }
  11.       min = Math.floor(tim / 60);
  12.       dsek = Math.floor((tim - 60 * min) / 10);
  13.       sek = Math.floor(tim - 60 * min - 10 * dsek);
  14.       timepanel = min + ":" + dsek + sek;
  15.    }
  16. }
  17. scorepanel = String(score);
  18. livespanel = String(lives);
  19. fire = false;
  20. if(_root.finishline._y > 350)
  21. {
  22.    engine_Sound.stop();
  23.    level_finish_Sound.start();
  24.    numlevel += 1;
  25.    gotoAndStop("wait_level");
  26.    play();
  27. }
  28. if(tim <= 0)
  29. {
  30.    lives -= 1;
  31.    livespanel = String(lives);
  32.    game_over_Sound.start();
  33.    if(lives <= 0)
  34.    {
  35.       gotoAndStop("game_over");
  36.       play();
  37.    }
  38.    else
  39.    {
  40.       gotoAndStop("time_out");
  41.       play();
  42.    }
  43. }
  44. if(trydead)
  45. {
  46.    trydead = false;
  47.    lives -= 1;
  48.    livespanel = String(lives);
  49.    var i = _root.getNextHighestDepth();
  50.    _root.attachMovie("expl","expl" + String(i),i,{_x:car._x,_y:car._y});
  51.    if(lives <= 0)
  52.    {
  53.       game_over_Sound.start();
  54.       gotoAndStop("game_over");
  55.       play();
  56.    }
  57.    else
  58.    {
  59.       gotoAndStop("dead");
  60.       play();
  61.    }
  62. }
  63. if(Key.isDown(27))
  64. {
  65.    lives = 1;
  66.    trydead = true;
  67.    engine_Sound.stop();
  68. }
  69.