home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / GeoMatch.dxr / 00022_GameOver_Button.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  4.7 KB  |  132 lines

  1. property spriteNum
  2. global gFlagRotation, gGameCountries, gFlag, gCountY, gCountX, gRemove, gCount, gNumSelected, gSelectNum1X, gSelectNum1Y, gSelectNum2X, gSelectNum2Y, gSelectNum3X, gSelectNum3Y, gScore, gLevel, pAdd, gTimeLoop, gPaused
  3.  
  4. on beginSprite
  5.   if gLevel <= 3 then
  6.     puppetSound(5, "gameoverSound")
  7.   else
  8.     puppetSound(5, "youwin")
  9.     sprite(36).blend = 100
  10.     sprite(37).blend = 100
  11.     member("GameOver_Score").text = "Total Score:" & RETURN & RETURN & string(gScore)
  12.     sprite(3).rewind()
  13.     sprite(3).pause()
  14.   end if
  15. end
  16.  
  17. on mouseEnter
  18.   puppetSound(3, "ButtonOver")
  19. end
  20.  
  21. on mouseWithin
  22.   sprite(spriteNum).member = "restartOver"
  23. end
  24.  
  25. on mouseLeave
  26.   sprite(spriteNum).member = "RestartNorm"
  27.   puppetSound(4, "ButtonOver")
  28. end
  29.  
  30. on mouseUp
  31.   puppetSound(2, "resetSound")
  32.   repeat with gRemove = 25 to 28
  33.     sprite(gRemove).ink = 4
  34.   end repeat
  35.   repeat with gRemove = 36 to 91
  36.     sprite(gRemove).visible = 0
  37.   end repeat
  38.   sprite(3).rewind()
  39.   sprite(3).resume()
  40.   gTimeLoop = 0
  41.   gNumSelected = 0
  42.   gScore = 0
  43.   member("score_text").text = string(gScore)
  44.   gLevel = 1
  45.   member("level_text").text = string(gLevel)
  46.   gGameCountries = [[1, 2, 3, 4], [5, 6, 1, 2], [3, 4, 5, 6], [1, 2, 4, 6]]
  47.   gFlagRotation = [[0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3]]
  48.   repeat with gCountY = 0 to 3
  49.     repeat with gCountX = 0 to 3
  50.       if gLevel = 1 then
  51.         gFlag = random(6)
  52.         case gFlag of
  53.           1:
  54.             sprite(5 + gCountX + (gCountY * 4)).member = "us_flag_animation"
  55.           2:
  56.             sprite(5 + gCountX + (gCountY * 4)).member = "can_flag_animation"
  57.           3:
  58.             sprite(5 + gCountX + (gCountY * 4)).member = "mexico_flag_animation"
  59.           4:
  60.             sprite(5 + gCountX + (gCountY * 4)).member = "uk_flag_animation"
  61.           5:
  62.             sprite(5 + gCountX + (gCountY * 4)).member = "french_flag_animation"
  63.           6:
  64.             sprite(5 + gCountX + (gCountY * 4)).member = "german_flag_animation"
  65.         end case
  66.       else
  67.         if gLevel = 2 then
  68.           gFlag = random(9)
  69.           case gFlag of
  70.             1:
  71.               sprite(5 + gCountX + (gCountY * 4)).member = "us_flag_animation"
  72.             2:
  73.               sprite(5 + gCountX + (gCountY * 4)).member = "can_flag_animation"
  74.             3:
  75.               sprite(5 + gCountX + (gCountY * 4)).member = "mexico_flag_animation"
  76.             4:
  77.               sprite(5 + gCountX + (gCountY * 4)).member = "uk_flag_animation"
  78.             5:
  79.               sprite(5 + gCountX + (gCountY * 4)).member = "french_flag_animation"
  80.             6:
  81.               sprite(5 + gCountX + (gCountY * 4)).member = "german_flag_animation"
  82.             7:
  83.               sprite(5 + gCountX + (gCountY * 4)).member = "zimbabwe_flag_animation"
  84.             8:
  85.               sprite(5 + gCountX + (gCountY * 4)).member = "sAfrica_flag_animation"
  86.             9:
  87.               sprite(5 + gCountX + (gCountY * 4)).member = "Kenya_flag_animation"
  88.           end case
  89.         else
  90.           if gLevel = 3 then
  91.             gFlag = random(12)
  92.             case gFlag of
  93.               1:
  94.                 sprite(5 + gCountX + (gCountY * 4)).member = "us_flag_animation"
  95.               2:
  96.                 sprite(5 + gCountX + (gCountY * 4)).member = "can_flag_animation"
  97.               3:
  98.                 sprite(5 + gCountX + (gCountY * 4)).member = "mexico_flag_animation"
  99.               4:
  100.                 sprite(5 + gCountX + (gCountY * 4)).member = "uk_flag_animation"
  101.               5:
  102.                 sprite(5 + gCountX + (gCountY * 4)).member = "french_flag_animation"
  103.               6:
  104.                 sprite(5 + gCountX + (gCountY * 4)).member = "german_flag_animation"
  105.               7:
  106.                 sprite(5 + gCountX + (gCountY * 4)).member = "zimbabwe_flag_animation"
  107.               8:
  108.                 sprite(5 + gCountX + (gCountY * 4)).member = "sAfrica_flag_animation"
  109.               9:
  110.                 sprite(5 + gCountX + (gCountY * 4)).member = "Kenya_flag_animation"
  111.               10:
  112.                 sprite(5 + gCountX + (gCountY * 4)).member = "china_flag_animation"
  113.               11:
  114.                 sprite(5 + gCountX + (gCountY * 4)).member = "japan_flag_animation"
  115.               12:
  116.                 sprite(5 + gCountX + (gCountY * 4)).member = "sKorea_flag_animation"
  117.             end case
  118.           end if
  119.         end if
  120.       end if
  121.       gGameCountries[gCountY + 1][gCountX + 1] = gFlag
  122.       gFlagRotation[gCountY + 1][gCountX + 1] = random(4) - 1
  123.       sprite(5 + gCountX + (gCountY * 4)).rotation = gFlagRotation[gCountY + 1][gCountX + 1] * 90
  124.       sprite(5 + gCountX + (gCountY * 4)).visible = 1
  125.       sprite(5 + gCountX + (gCountY * 4)).loc = point(194 + (gCountX * 109), 59 + (gCountY * 107))
  126.     end repeat
  127.   end repeat
  128.   gPaused = 0
  129.   startTimer()
  130.   go(1)
  131. end
  132.