home *** CD-ROM | disk | FTP | other *** search
/ Painter Bear's Language Bridge — Italian / Bridge_ponte_itialian.iso / pc / helpers / open.dxr / 00005_animations.ls < prev    next >
Encoding:
Text File  |  2001-02-22  |  3.4 KB  |  113 lines

  1. on startAnimaList whichAnimation, whichSprite
  2.   global gCurrAnimaList, gCurrAnima, gAnimationNow, gWhichAnimationSprite
  3.   set gWhichAnimationSprite to whichSprite
  4.   clearAnimalist()
  5.   updateStage()
  6.   set gAnimationNow to 1
  7.   set gCurrAnimaList to whichAnimation
  8. end
  9.  
  10. on advanceAnimaList
  11.   global gCurrAnimaList, gCurrAnima, gWhichAnimationSprite, gFdbkLst
  12.   set gCurrAnima to gCurrAnima + 1
  13.   if (gCurrAnimaList <> []) and (gCurrAnima <= count(gCurrAnimaList)) then
  14.     set the memberNum of sprite gWhichAnimationSprite to the number of member getAt(gCurrAnimaList, gCurrAnima)
  15.     updateStage()
  16.     if (getAt(gCurrAnimaList, gCurrAnima) = "bear 1 good 18") or (getAt(gCurrAnimaList, gCurrAnima) = "bear 1 bad 18") then
  17.       startSndList(gFdbkLst)
  18.       set gFdbkLst to []
  19.     else
  20.       if (getAt(gCurrAnimaList, 1) contains "good") or (getAt(gCurrAnimaList, 1) contains "bad") then
  21.         if not soundBusy(2) and (gCurrAnima >= 5) and (gCurrAnima < 15) then
  22.           set whichFart to random(14)
  23.           puppetSound(2, "fart" & whichFart)
  24.         end if
  25.       else
  26.         if (getAt(gCurrAnimaList, 1) contains "paint") and not soundBusy(2) then
  27.           if (gCurrAnima >= 21) and (gCurrAnima < 45) then
  28.             set whichFart to random(14)
  29.             puppetSound(2, "fart" & whichFart)
  30.           end if
  31.         end if
  32.       end if
  33.     end if
  34.   else
  35.     clearAnimalist()
  36.   end if
  37. end
  38.  
  39. on clearAnimalist
  40.   global gCurrAnimaList, gCurrAnima, gAnimationNow, gWhichAnimationSprite, gBridgeParts
  41.   set gAnimationNow to 0
  42.   if the frameLabel = "chooser" then
  43.     set the memberNum of sprite gWhichAnimationSprite to the number of member "bear m rest" of castLib "bear"
  44.   else
  45.     if the frameLabel = "bridge" then
  46.       if gBridgeParts = 10 then
  47.         set the memberNum of sprite gWhichAnimationSprite to the number of member "bear 1 fin 1" of castLib "bear"
  48.       else
  49.         set the memberNum of sprite gWhichAnimationSprite to the number of member "bear paint 1" of castLib "bear"
  50.       end if
  51.     else
  52.       set the memberNum of sprite gWhichAnimationSprite to the number of member "bear rest" of castLib "bear"
  53.     end if
  54.   end if
  55.   unloadMember(member "bear rest", "bear 1 fin 20")
  56.   set gCurrAnimaList to []
  57.   set gCurrAnima to 0
  58. end
  59.  
  60. on idleBear
  61.   global gBear, gBridgeParts
  62.   set tempLst to []
  63.   if the frameLabel = "chooser" then
  64.     set whichIdle to random(7)
  65.     case whichIdle of
  66.       "1", "4", "5":
  67.         set howMany to 19
  68.         set whichIdle to 1
  69.       "2":
  70.         set howMany to 20
  71.       "3", "6", "7":
  72.         set howMany to 20
  73.         set whichIdle to 3
  74.     end case
  75.     repeat with X = 1 to howMany
  76.       add(tempLst, "bear" && whichIdle & "m" && "idle " & X)
  77.     end repeat
  78.   else
  79.     if the frameLabel = "bridge" then
  80.       if gBridgeParts = 10 then
  81.         set howMany to 20
  82.         repeat with X = 1 to howMany
  83.           add(tempLst, "bear 1 fin " & X)
  84.         end repeat
  85.       else
  86.         set howMany to 45
  87.         repeat with X = 1 to howMany
  88.           add(tempLst, "bear paint " & X)
  89.         end repeat
  90.       end if
  91.     else
  92.       set whichIdle to random(7)
  93.       case whichIdle of
  94.         "1", "4", "5", "6", "7":
  95.           set howMany to 20
  96.           set whichIdle to 1
  97.         "2":
  98.           set howMany to 20
  99.         "3":
  100.           set howMany to 20
  101.       end case
  102.       repeat with X = 1 to howMany
  103.         add(tempLst, "bear" && whichIdle && "idle " & X)
  104.       end repeat
  105.     end if
  106.   end if
  107.   startAnimaList(tempLst, gBear)
  108. end
  109.  
  110. on fillBearsTime
  111.   idleBear()
  112. end
  113.