home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / superman.swf / scripts / frame_17 / DoAction.as < prev   
Encoding:
Text File  |  2006-06-07  |  1.0 KB  |  51 lines

  1. function newGame()
  2. {
  3.    _root.gScore = 0;
  4.    _root.gLevel = 1;
  5.    a = 0;
  6.    while(a < 20)
  7.    {
  8.       meteors[a] = 0;
  9.       meteors_x[a] = 0;
  10.       meteors_y[a] = 0;
  11.       a++;
  12.    }
  13.    gotoAndStop("NextLevel");
  14.    play();
  15. }
  16. function displayScore(countup)
  17. {
  18.    if(countup == true)
  19.    {
  20.       scoregoal = scoregoal >= _root.gScore ? _root.gScore : scoregoal + 5;
  21.    }
  22.    else
  23.    {
  24.       scoregoal = _root.gScore;
  25.    }
  26.    tmpscore = "" add scoregoal;
  27.    zeros = "";
  28.    a = tmpscore.length;
  29.    while(a < 10)
  30.    {
  31.       zeros = zeros add "0";
  32.       a++;
  33.    }
  34.    score_display = zeros add scoregoal;
  35.    collectedtext = collected >= 10 ? "" add collected : "0" add collected;
  36.    maxmeteortext = maxmeteors >= 10 ? "" add maxmeteors : "0" add maxmeteors;
  37.    statustext = collectedtext add " / " add maxmeteortext;
  38. }
  39. meteors = Array[20];
  40. meteors_speed = Array[20];
  41. player_x = 0;
  42. player_y = 0;
  43. spped = 0;
  44. altitude = 0;
  45. piecesize = 64;
  46. livesleft = 0;
  47. meteorsleft = 0;
  48. meteorcounter = 0;
  49. hits = 0;
  50. misses = 0;
  51.