home *** CD-ROM | disk | FTP | other *** search
/ A Virtual Reality Guide to Texas / CD.iso / texdata / shared.cst / 00031.ls < prev    next >
Encoding:
Text File  |  1998-06-17  |  5.1 KB  |  241 lines

  1. --on ButtonDown doWhat
  2. --  put the clickon into MySprite
  3. --  
  4. --  puppetSprite MySprite, False
  5. --  go the frame
  6. --  
  7. --  put "interface 50%" into UpSound
  8. --  put "interface 6 25%" into DownSound
  9. --  
  10. --  UpdateStage
  11. --  put the castnum of sprite MySprite into UpCast
  12. --  put UpCast + 10 into DownCast
  13. --  
  14. --  PuppetSprite MySprite, True
  15. --  
  16. --  put True into OnMe
  17. --  put True into isUp
  18. --  
  19. --  repeat while the stillDown
  20. --    Idle
  21. --    put RollOver(MySprite) into OnMe
  22. --    
  23. --    if OnMe then
  24. --      set the castNum of sprite MySprite to DownCast
  25. --      if isUp then
  26. --        PlayAsync(DownSound)
  27. --        put False into isUp
  28. --      end if
  29. --      
  30. --    else
  31. --      set the castNum of sprite MySprite to UpCast
  32. --      if not isUp then
  33. --        --PlaySync(UpSound)
  34. --        put True into isUp
  35. --      end if
  36. --      
  37. --    end if
  38. --    
  39. --    UpdateStage
  40. --  end repeat
  41. --  
  42. --  puppetSprite MySprite, False
  43. --  UpdateStage
  44. --  
  45. --  if OnMe and not VoidP(doWhat) then do doWhat
  46. --  
  47. --  if not isUp then
  48. --    -- PlaySync(UpSound)
  49. --    put True into isUp
  50. --  end if
  51. --  
  52. --  
  53. --end
  54. --
  55. --on PlayAsync WhatSound
  56. --  if not VoidP( WhatSound) then
  57. --    PuppetSound WhatSound
  58. --    UpdateStage
  59. --  end if
  60. --end
  61. --
  62. --On PlaySync WhatSound
  63. --  PuppetSound WhatSound
  64. --  UpdateStage
  65. --  repeat while soundbusy(1)
  66. --    UpdateStage
  67. --  end repeat
  68. --  PuppetSound 0
  69. --end
  70. --
  71. --on goHome
  72. --  ResetAudio
  73. --  EndPlay
  74. --end
  75. --
  76. --on SetVisit Where
  77. --  Global gSections
  78. --  CheckSectionHits
  79. --  SetProp(gSections, Where, 1)
  80. --end
  81. --
  82. --on CheckSectionHits
  83. --  global gSections
  84. --  if voidP(gSections) then  set gSections = [#context:0,#resell:0, #invest:0, #partner:0, #program:0 ]
  85. --end
  86. --
  87. --on UpdateSectionHits
  88. --  Global gSections
  89. --  repeat with i = 1 to 5
  90. --    set visited  = getAt(gSections,i ) 
  91. --    if visited then
  92. --      put i + 22 into MySprite
  93. --      PuppetSprite MySprite, True
  94. --      set the castNum of sprite MySprite to (i + 70)
  95. --    end if
  96. --  end repeat
  97. --end
  98. --
  99. --on GoSection WhatSection
  100. --  put marker( WhatSection) into LoadFrom
  101. --  
  102. --  cursor 4
  103. --  Preload LoadFrom, LoadFrom + 6
  104. --  cursor -1
  105. --  
  106. --  go WhatSection
  107. --end
  108. --
  109. --on ZeroSync
  110. --  ClearMovieSync
  111. --end
  112. --
  113. --on WaitForSecondsToRound
  114. --  cursor 4
  115. --  put GetSeconds() into StartSecs
  116. --  repeat while GetSeconds() = StartSecs
  117. --    UpdateStage
  118. --  end repeat
  119. --  cursor -1
  120. --end
  121. --
  122. --on StartSync FPS
  123. --  Global gHardSync, gStartDev, gFPS, gStartFrame, gStartTime, gLastTime, gSyncableMovie
  124. --  Global gLoopNeedsStarting
  125. --  
  126. --  put true into gSyncableMovie
  127. --  put float(FPS) into gFPS
  128. --  resetAudio
  129. --  put GetSeconds() into gStartDev
  130. --  put gStartDev into gHardSync
  131. --  put gStartDev into gLastTime
  132. --  
  133. --  put the frame + 1 into gStartFrame
  134. --  put the ticks into gStartTime
  135. --  
  136. --  WaitForSecondsToRound
  137. --  
  138. --  CheckHardSync
  139. --  SyncTicksToFrame
  140. --  
  141. --  put true into gLoopNeedsStarting
  142. --  
  143. --end
  144. --
  145. --on SyncTicksToFrame
  146. --  Global gStartTime, gFPS
  147. --  put the ticks - ((the frame / gFPS) * 60.0) into gStartTime
  148. --end
  149. --
  150. --on SyncFrametoTicks
  151. --  Global gStartTime, gFPS, gStartFrame, gSyncableMovie
  152. --  if gSyncableMovie then
  153. --    CheckHardSync
  154. --    CheckRollover
  155. --    
  156. --    put integer((((the ticks - gStartTime)/60.0) * gFPS) + gStartFrame) into requestedFrame
  157. --    go frame requestedFrame
  158. --  end if
  159. --end
  160. --
  161. --on CheckHardSync
  162. --  Global gStartTime, gHardSync, gLastTime, gFPS, gStartDev, gStartFrame
  163. --  
  164. --  put GetSeconds() into MySeconds
  165. --  
  166. --  put MySeconds - gLastTime into Deviation
  167. --  
  168. --  if Deviation < 0 then put Deviation + 60 into Deviation
  169. --  put deviation + gHardSync into gHardSync
  170. --  
  171. --  if Deviation <> 0 then 
  172. --    put (gHardSync - gStartDev) * gFPS into NewFrame
  173. --    put (NewFrame + gStartFrame - gFPS) into requestedFrame
  174. --    put abs(the frame - requestedFrame) into FrameDiff
  175. --    if FrameDiff > 12 then
  176. --      go frame requestedFrame
  177. --      SyncTicksToFrame
  178. --      Put "Needed Sync!" && FrameDiff
  179. --    end if
  180. --  end if
  181. --  
  182. --  put MySeconds into gLastTime
  183. --end
  184. --
  185. --on GetSeconds
  186. --  put the long time into MyTime
  187. --  set the itemDelimiter to ":"
  188. --  put value(word 1 of item 3 of MyTime) into MySeconds
  189. --  return MySeconds
  190. --end
  191. --
  192. --on CheckRollover
  193. --  CheckRoll(32)
  194. --  CheckRoll(33)
  195. --  CheckRoll(34)
  196. --  CheckRoll(35)
  197. --end
  198. --
  199. --on CheckRoll WhichSprite
  200. --  if rollover(WhichSprite) then
  201. --    SetCast(WhichSprite, 939 + WhichSprite)
  202. --  else
  203. --    SetCast(WhichSprite, 919 + WhichSprite)
  204. --    PuppetSprite WhichSprite, False
  205. --  end if
  206. --end
  207. --
  208. --on SetCast WhichSprite, WhatCast
  209. --  PuppetSprite WhichSprite, True
  210. --  set the castNum of sprite WhichSprite to WhatCast
  211. --end
  212. --
  213. --on PauseMovie
  214. --  cursor 4
  215. --  if MovieIsPresent() then set the movieRate of sprite 48 to False
  216. --  cursor -1
  217. --end
  218. --
  219. --on unPauseMovie
  220. --  cursor 4
  221. --  if MovieIsPresent() then set the movieRate of sprite 48 to True
  222. --  cursor -1
  223. --end
  224. --
  225. --on TogglePause
  226. --  if MovieIsPresent() then set the movieRate of sprite 48 to not the movieRate of sprite 48
  227. --end
  228. --
  229. --on MovieIsPresent
  230. --  return the castNum of sprite 48
  231. --end
  232. --
  233. --on ResetAudio
  234. --  sound stop 0
  235. --  sound stop 1
  236. --  sound stop 2
  237. --  PuppetSound 1, 0
  238. --  PuppetSound 2, 0
  239. --  PuppetSound 0
  240. --  UpdateStage
  241. --end