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

  1. on startSndList someSnds
  2.   global gCurrSndList, gCurrSnd, gPlayingClue
  3.   clearSndList()
  4.   set gPlayingClue to 1
  5.   set gCurrSndList to someSnds
  6. end
  7.  
  8. on advanceSndList
  9.   global gCurrSndList, gCurrSnd, gFileDelimiter, gListOfCuePoints
  10.   if not soundBusy(1) then
  11.     set gCurrSnd to gCurrSnd + 1
  12.     if (gCurrSndList <> []) and (gCurrSnd <= count(gCurrSndList)) then
  13.       sound playFile 1, getAt(gCurrSndList, gCurrSnd)
  14.     else
  15.       clearSndList()
  16.     end if
  17.   end if
  18. end
  19.  
  20. on clearSndList
  21.   global gCurrSndList, gCurrSnd, gPlayingClue, gHelpPlaying
  22.   set gHelpPlaying to 0
  23.   set gPlayingClue to 0
  24.   sound stop 1
  25.   set gCurrSndList to []
  26.   set gCurrSnd to 0
  27. end
  28.  
  29. on playrllovrSnd whichBtn
  30.   global gSndPath, gLangSelect, gLangDirect, gFileDelimiter, gHelpPlaying
  31.   if not soundBusy(1) then
  32.     set gHelpPlaying to 0
  33.     set whichSnd to word 1 of the name of member the memberNum of sprite whichBtn of castLib "chooser"
  34.     if gLangDirect = 1 then
  35.       sound playFile 1, gSndPath & "e" & gFileDelimiter & "catName" & gFileDelimiter & whichSnd & ".aif"
  36.     else
  37.       sound playFile 1, gSndPath & gLangSelect & gFileDelimiter & "catName" & gFileDelimiter & whichSnd & ".aif"
  38.     end if
  39.   end if
  40. end
  41.  
  42. on doMusicBtn
  43.   global gMusOn, gMusBtn
  44.   if gMusOn = 0 then
  45.     set the memberNum of sprite gMusBtn to the number of member "music off" of castLib "shared"
  46.   end if
  47. end
  48.  
  49. on doMusic
  50.   global gMusOn, gMusBtn
  51.   if gMusOn = 1 then
  52.     set gMusOn to 0
  53.     sound stop 3
  54.     set the memberNum of sprite gMusBtn to the number of member "music off" of castLib "shared"
  55.   else
  56.     set gMusOn to 1
  57.     puppetSound(3, "loop")
  58.     set the memberNum of sprite gMusBtn to the number of member "music up" of castLib "shared"
  59.   end if
  60. end
  61.  
  62. on playAnswer whichSpt
  63.   set foo to the name of member the memberNum of sprite whichSpt of castLib "quiz"
  64.   set whichAns to word 1 of foo
  65.   set whichAns to (whichAns * 2) - 1
  66.   repeatSnd("answer", whichAns)
  67. end
  68.  
  69. on repeatSnd whichSnd, whichAns
  70.   global gLangDirect, gSndPath, gFileDelimiter, gLangSelect, gCat, gWhichQuest, gAnsSndLst, gQuestSndLst, gCurrSndList
  71.   if gCurrSndList = [] then
  72.     set tempLst to []
  73.     case whichSnd of
  74.       "question":
  75.         startSndList(gQuestSndLst)
  76.       "answer":
  77.         set getNum to value(whichAns)
  78.         add(tempLst, getAt(gAnsSndLst, getNum))
  79.         startSndList(tempLst)
  80.     end case
  81.   end if
  82. end
  83.  
  84. on doHelp
  85.   global gSndPath, gLangDirect, gLangSelect, gFileDelimiter, gHelpPlaying
  86.   if soundBusy(1) then
  87.     sound stop 1
  88.     clearSndList()
  89.   else
  90.     set gHelpPlaying to 1
  91.     case the frameLabel of
  92.       "chooser":
  93.         set whichHelp to "main.AIF"
  94.       "quiz":
  95.         set whichHelp to "test.AIF"
  96.       "find":
  97.         set whichHelp to "palette.AIF"
  98.     end case
  99.     if gLangDirect = 1 then
  100.       sound playFile 1, gSndPath & "e" & gFileDelimiter & whichHelp
  101.     else
  102.       sound playFile 1, gSndPath & gLangSelect & gFileDelimiter & whichHelp
  103.     end if
  104.   end if
  105. end
  106.  
  107. on doFeedBack
  108.   global gAnswerRight, gBear, gFdbkLst, gSndPath, gFileDelimiter
  109.   cursor(4)
  110.   set gFdbkLst to []
  111.   set tempLst to []
  112.   case gAnswerRight of
  113.     "1":
  114.       set wording to "good"
  115.       set whichWay to random(1)
  116.       case whichWay of
  117.         "1":
  118.           set howMany to 33
  119.       end case
  120.       set whichSndBk to random(6)
  121.     "0":
  122.       set wording to "bad"
  123.       set whichWay to random(1)
  124.       case whichWay of
  125.         "1":
  126.           set howMany to 33
  127.       end case
  128.       set whichSndBk to random(3)
  129.   end case
  130.   set whichSndBk to gSndPath & "bear" & gFileDelimiter & wording & whichSndBk & ".aif"
  131.   add(gFdbkLst, whichSndBk)
  132.   repeat with X = 1 to howMany
  133.     add(tempLst, "bear " & whichWay && wording && X)
  134.   end repeat
  135.   preloadMember(member ("bear " & whichWay && wording && "1"), "bear " & whichWay && wording && howMany)
  136.   startAnimaList(tempLst, gBear)
  137.   cursor(-1)
  138. end
  139.