home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / freaky-fun.swf / scripts / frame_7 / DoAction.as
Encoding:
Text File  |  2006-06-07  |  1.1 KB  |  57 lines

  1. lives = 200;
  2. level = 1;
  3. score = 0;
  4. playGame = true;
  5. this.onEnterFrame = function()
  6. {
  7.    napis = "Level:  " + level + "/25" + "      Score:  " + score;
  8.    if(wyjscie.hitTest(hero))
  9.    {
  10.       wyjscie.play();
  11.    }
  12.    if(heart.tester.hitTest(hero))
  13.    {
  14.       score += 1000;
  15.       heart.play();
  16.    }
  17.    i = 0;
  18.    while(i < 20)
  19.    {
  20.       var reff = eval("enemy" + i);
  21.       reff.onEnterFrame = function()
  22.       {
  23.          if(this.tester.hitTest(hero))
  24.          {
  25.             playGame = false;
  26.             hero.gotoAndStop(3);
  27.          }
  28.       };
  29.       var ref = eval("coin" + i);
  30.       ref.onEnterFrame = function()
  31.       {
  32.          if(this.tester.hitTest(hero))
  33.          {
  34.             score += 100;
  35.             this.play();
  36.          }
  37.       };
  38.       i++;
  39.    }
  40. };
  41. restart = function()
  42. {
  43.    enemy5._x = enemy5.X;
  44.    _root.ground.gotoAndStop(random(_root.ground._totalframes) + 1);
  45.    hero._rotation = 0;
  46.    hero.gotoAndStop(1);
  47.    hero.heroClip.stop();
  48.    jumping = false;
  49.    playGame = true;
  50.    hero._x = 48;
  51.    hero._y = 90;
  52.    enemy19._x = enemy19.X;
  53.    enemy19._xscale = 100;
  54.    enemy19.count = 0;
  55.    enemy19.n = -1;
  56. };
  57.