home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / sheriff_tripeaks.swf / scripts / DefineSprite_352 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.0 KB  |  48 lines

  1. function showForLoose(is_time_out)
  2. {
  3.    _root.game_over_sfx.start(0,1);
  4.    result_star._visible = false;
  5.    txtScore = "GAME     OVER";
  6.    txtMsg = !is_time_out ? "NO     MORE     MOVES!" : "TIME     OUT!";
  7.    _visible = true;
  8. }
  9. function showForWin(sc, c)
  10. {
  11.    _root.level_done_sfx.start(0,1);
  12.    if(c)
  13.    {
  14.       txtMsg = "LEVEL     COMPLETE";
  15.    }
  16.    else
  17.    {
  18.       txtMsg = "GAME     COMPLETE!!!";
  19.    }
  20.    txtScore = "YOUR    SCORE:     " + String(sc);
  21.    result_star.gotoAndStop(_root.AwardType(_global.Levels.selectedLevel - 1));
  22.    _visible = true;
  23. }
  24. function hideMe()
  25. {
  26.    txtMsg = "";
  27.    txtScore = "";
  28.    _visible = false;
  29. }
  30. _root.total_score = 0;
  31. var c = 0;
  32. while(c < 25)
  33. {
  34.    var one_level_score = _global.Settings.playedScores[c];
  35.    if(one_level_score > 0)
  36.    {
  37.       _root.total_score += one_level_score;
  38.    }
  39.    c++;
  40. }
  41. _root.total_score_str = String("TOTAL     SCORE:     " + _root.total_score);
  42. btnExit.onPress = function()
  43. {
  44.    hideMe();
  45.    _root.gotoAndPlay("preLevelsFrame");
  46. };
  47. hideMe();
  48.