home *** CD-ROM | disk | FTP | other *** search
/ Blender Volume 3 #3 / BLENDER.iso / pc / files / main.dxr / 00148_main.ls < prev    next >
Encoding:
Text File  |  1997-01-01  |  5.7 KB  |  277 lines

  1. global gbunnyup, gmyRadio, gheadstoneUp, gOpSys, DELIMITER, CDDrive, gHeadstoneSprite, gheadstonestart, gGroup1L, gGroup2L, gGroup3L, gGroup4L, gGroup1R, gGroup2R, gGroup3R, gGroup4R, gListL, gListR, gfirstout, gstartframe, gIgnoreGroup
  2.  
  3. on startMovie
  4.   if voidp(CDDrive) then
  5.     if the machineType = 256 then
  6.       set DELIMITER to "\"
  7.       set CDDrive to getCDdrive()
  8.       set gOpSys to #WIN
  9.     else
  10.       set DELIMITER to ":"
  11.       set CDDrive to "blender5"
  12.       set gOpSys to #MAC
  13.     end if
  14.   end if
  15.   initstuff()
  16.   rubberpreLoad()
  17.   set gHeadstoneSprite to 31
  18.   pass()
  19. end
  20.  
  21. on rubberpreLoad
  22.   preLoad("preStart", "preStop")
  23. end
  24.  
  25. on stopMovie
  26.   nothing()
  27. end
  28.  
  29. on initstuff
  30.   put 0 into field "miss"
  31.   put 0 into field "hits"
  32.   set gmyRadio to EMPTY
  33.   set the volume of sound 1 to 200
  34.   set the volume of sound 2 to 200
  35.   set the volume of sound 3 to 256
  36.   puppetSprite(4, 0)
  37. end
  38.  
  39. on startGame
  40.   initstuff()
  41.   repeat with x = 5 to 20
  42.     set the visible of sprite x to 0
  43.   end repeat
  44.   makeLists()
  45.   set the visible of sprite 6 to 1
  46.   set the visible of sprite 7 to 1
  47.   set gfirstout to 1
  48.   set the volume of sound 3 to 256
  49.   go("loop1")
  50.   setCurs()
  51.   set the volume of sound 1 to 200
  52.   set the volume of sound 2 to 200
  53. end
  54.  
  55. on makeLists
  56.   set gGroup1L to list(5, 7)
  57.   set gGroup2L to list(9, 11)
  58.   set gGroup3L to list(13, 15)
  59.   set gGroup4L to list(17, 19)
  60.   set gGroup1R to list(6, 8)
  61.   set gGroup2R to list(10, 12)
  62.   set gGroup3R to list(14, 16)
  63.   set gGroup4R to list(18, 20)
  64.   set gListL to list(gGroup1L, gGroup2L, gGroup3L, gGroup4L)
  65.   set gListR to list(gGroup1R, gGroup2R, gGroup3R, gGroup4R)
  66. end
  67.  
  68. on setCurs
  69.   set the cursor of sprite 4 to [member "ch1", member "ch1mask"]
  70.   repeat with x = 33 to 48
  71.     if (x = 40) or (x = 41) or (x = 42) or (x = 43) or (x = 45) then
  72.       nothing()
  73.       next repeat
  74.     end if
  75.     set the cursor of sprite x to [member "hand", member "hand mask"]
  76.   end repeat
  77. end
  78.  
  79. on visibleBunnies
  80.   howmanyleft()
  81.   set what to random(2)
  82.   if what > 1 then
  83.     exit
  84.   end if
  85.   if gfirstout then
  86.     exit
  87.   end if
  88.   set whichR to random(2)
  89.   set whichL to random(2)
  90.   if whichR = 1 then
  91.     set otherR to 2
  92.   else
  93.     set otherR to 1
  94.   end if
  95.   if whichL = 1 then
  96.     set otherL to 2
  97.   else
  98.     set otherL to 1
  99.   end if
  100.   set whichNum to char the number of chars in gstartframe of gstartframe
  101.   set whichNum to integer(whichNum)
  102.   if whichNum > count(gListR) then
  103.     exit
  104.   end if
  105.   set myListL to getAt(gListL, whichNum)
  106.   set myListR to getAt(gListR, whichNum)
  107.   set visibleL to getAt(myListL, whichL)
  108.   set visibleR to getAt(myListR, whichR)
  109.   set invisibleL to getAt(myListL, otherL)
  110.   set invisibleR to getAt(myListR, otherR)
  111.   set the visible of sprite invisibleL to 0
  112.   set the visible of sprite invisibleR to 0
  113.   set the visible of sprite visibleL to 1
  114.   set the visible of sprite visibleR to 1
  115. end
  116.  
  117. on bunnyUp
  118.   set gbunnyup to 1
  119.   puppetSound(1, "squeal")
  120.   set whichBunny to random(3)
  121.   set offset to 104
  122.   case whichBunny of
  123.     1:
  124.       puppetSprite(8, 1)
  125.       set the locH of sprite 8 to 143 + offset + random(154)
  126.     2:
  127.       puppetSprite(9, 1)
  128.       set the locH of sprite 9 to 70 + offset + random(307)
  129.     3:
  130.       puppetSprite(10, 1)
  131.       set the locH of sprite 10 to 43 + offset + random(348)
  132.   end case
  133. end
  134.  
  135. on bunnydown
  136.   set gheadstoneUp to 1
  137.   repeat with i = 8 to 10
  138.     set the locH of sprite i to -100
  139.     set the member of sprite i to member ("bunny" && i - 7)
  140.     puppetSprite(i, 0)
  141.   end repeat
  142.   unPuff()
  143. end
  144.  
  145. on kill theBunny
  146.   if not gbunnyup then
  147.     exit
  148.   end if
  149.   set gbunnyup to 0
  150.   puppetSound(1, "hurt")
  151.   set theSprite to the clickOn
  152.   case theBunny of
  153.     1:
  154.       set points to 1
  155.     2:
  156.       set points to 1
  157.     3:
  158.       set points to 1
  159.       set theSprite to 10
  160.   end case
  161.   set the member of sprite theSprite to member ("splat" && theBunny)
  162.   updateStage()
  163.   addtoHit(points)
  164. end
  165.  
  166. on bury theCorpse
  167.   puppetSound(1, "hurt")
  168.   puppetSprite(gHeadstoneSprite, 1)
  169.   set theSprite to the clickOn
  170.   set the visible of sprite the clickOn to 0
  171.   set the loc of sprite gHeadstoneSprite to the loc of sprite the clickOn
  172.   updateStage()
  173.   set points to 1
  174.   addtoHit(points)
  175. end
  176.  
  177. on howmanyleft
  178.   put field "miss" into field "sm"
  179.   put field "hits" into field "sh"
  180.   if (field "sh" >= 21) and (count(gListL) > 3) then
  181.     deleteAt(gListL, 4)
  182.     deleteAt(gListR, 4)
  183.   end if
  184. end
  185.  
  186. on puff
  187.   puppetSound(2, 0)
  188.   puppetSound(2, "puff")
  189.   addtoMiss()
  190.   set gheadstoneUp to the ticks
  191. end
  192.  
  193. on missed
  194. end
  195.  
  196. on airshot
  197.   puppetSound(2, 0)
  198.   puppetSound(2, "puff")
  199.   addtoMiss()
  200. end
  201.  
  202. on addtoMiss
  203.   put integer(field "miss") + 1 into field "miss"
  204.   checkDone()
  205. end
  206.  
  207. on addtoHit points
  208.   put integer(field "hits") + points into field "hits"
  209.   checkDone()
  210. end
  211.  
  212. on checkDone
  213.   if (field "hits" > 24) or ((field "miss" + field "hits") >= 50) then
  214.     put field "miss" into field "sm"
  215.     put field "hits" into field "sh"
  216.     startTimer()
  217.     nopuppets()
  218.     resetsprites()
  219.     set the volume of sound 1 to 256
  220.     set the volume of sound 2 to 256
  221.     go("booth")
  222.   end if
  223. end
  224.  
  225. on shutup
  226.   repeat with x = 1 to 8
  227.     sound stop x
  228.   end repeat
  229. end
  230.  
  231. on loseheadstone
  232.   if (the ticks - gheadstonestart) > 60 then
  233.     set the loc of sprite gHeadstoneSprite to point(0, -200)
  234.     updateStage()
  235.   end if
  236. end
  237.  
  238. on turnTheKnob
  239.   if the mouseDown then
  240.     puppetSprite(39, 1)
  241.     set the castNum of sprite 39 to cast "radioPotLoop1"
  242.     set the ink of sprite 39 to 8
  243.     updateStage()
  244.   else
  245.     nothing()
  246.   end if
  247. end
  248.  
  249. on nopuppets
  250.   repeat with i = 1 to 48
  251.     puppetSprite(i, 0)
  252.   end repeat
  253. end
  254.  
  255. on puppetsOff
  256.   nopuppets()
  257. end
  258.  
  259. on resetsprites
  260.   repeat with x = 1 to 48
  261.     set the visible of sprite x to 1
  262.   end repeat
  263. end
  264.  
  265. on resetCursors
  266.   repeat with x = 1 to 48
  267.     set the cursor of sprite x to -1
  268.   end repeat
  269. end
  270.  
  271. on exitGame
  272.   resetCursors()
  273.   resetsprites()
  274.   nopuppets()
  275.   go("OPEN", "CONTENTS.DIR")
  276. end
  277.