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

  1. property spriteNum
  2. global gFlagRotation, gGameCountries, gFlag, gCountY, gCountX, gRemove, gCount, gNumSelected, gSelectNum1X, gSelectNum1Y, gSelectNum2X, gSelectNum2Y, gSelectNum3X, gSelectNum3Y, gScore, gLevel, gPaused
  3.  
  4. on mouseWithin
  5.   if gPaused = 0 then
  6.     sprite(spriteNum).ink = 0
  7.     repeat while mouseDown()
  8.       sprite(spriteNum).ink = 33
  9.       updateStage()
  10.     end repeat
  11.   end if
  12. end
  13.  
  14. on mouseLeave
  15.   sprite(spriteNum).ink = 4
  16. end
  17.  
  18. on mouseUp
  19.   if gPaused = 0 then
  20.     sprite(3).rewind()
  21.     sprite(3).resume()
  22.     repeat with gRemove = 39 to 91
  23.       sprite(gRemove).visible = 0
  24.     end repeat
  25.     gNumSelected = 0
  26.     gScore = 0
  27.     member("score_text").text = string(gScore)
  28.     gLevel = 1
  29.     member("level_text").text = string(gLevel)
  30.     gGameCountries = [[1, 2, 3, 4], [5, 6, 1, 2], [3, 4, 5, 6], [1, 2, 4, 6]]
  31.     gFlagRotation = [[0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3]]
  32.     repeat with gCountY = 0 to 3
  33.       repeat with gCountX = 0 to 3
  34.         gFlag = random(6)
  35.         case gFlag of
  36.           1:
  37.             sprite(5 + gCountX + (gCountY * 4)).member = "us_flag_animation"
  38.           2:
  39.             sprite(5 + gCountX + (gCountY * 4)).member = "can_flag_animation"
  40.           3:
  41.             sprite(5 + gCountX + (gCountY * 4)).member = "mexico_flag_animation"
  42.           4:
  43.             sprite(5 + gCountX + (gCountY * 4)).member = "uk_flag_animation"
  44.           5:
  45.             sprite(5 + gCountX + (gCountY * 4)).member = "french_flag_animation"
  46.           6:
  47.             sprite(5 + gCountX + (gCountY * 4)).member = "german_flag_animation"
  48.         end case
  49.         gGameCountries[gCountY + 1][gCountX + 1] = gFlag
  50.         gFlagRotation[gCountY + 1][gCountX + 1] = random(4) - 1
  51.         sprite(5 + gCountX + (gCountY * 4)).rotation = gFlagRotation[gCountY + 1][gCountX + 1] * 90
  52.         sprite(5 + gCountX + (gCountY * 4)).visible = 1
  53.         sprite(5 + gCountX + (gCountY * 4)).loc = point(194 + (gCountX * 109), 59 + (gCountY * 107))
  54.       end repeat
  55.     end repeat
  56.     sprite(37).visible = 0
  57.     sprite(36).visible = 0
  58.     sprite(3).rewind()
  59.     startTimer()
  60.   end if
  61. end
  62.