Arngrim

Time Line

Apr 24th, 2021 (edited)
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.47 KB | None | 0 0
  1. Option Explicit
  2. Randomize
  3.  
  4. On Error Resume Next
  5. ExecuteGlobal GetTextFile("controller.vbs")
  6. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  7. On Error Goto 0
  8.  
  9. Const cGameName="tmachzac",UseSolenoids=1,UseLamps=0,UseGI=0,SSolenoidOn="SolOn",SSolenoidOff="SolOff", SCoin="coin"
  10.  
  11. LoadVPM "01560000","ZAC2.VBS",3.2
  12.  
  13. Dim DesktopMode: DesktopMode = Table1.ShowDT
  14. If DesktopMode = True Then 'Show Desktop components
  15. Ramp16.visible=1
  16. Ramp15.visible=1
  17. Primitive46.visible=1
  18. Else
  19. Ramp16.visible=0
  20. Ramp15.visible=0
  21. Primitive46.visible=0
  22. End if
  23.  
  24. '*************************************************************
  25. 'Solenoid Call backs
  26. '**********************************************************************************************************
  27. SolCallback(1) = "bsKicker.SolOut"
  28. SolCallback(4) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
  29. SolCallback(5) = "LeftDropTargetBank.SolDropUp"
  30. SolCallback(6) = "RightDropTargetBank.SolDropUp"
  31. SolCallback(21) = "MotorRelay"
  32. SolCallback(24) = "bsTrough.SolOut"
  33.  
  34. SolCallback(sLRFlipper) = "SolRFlipper"
  35. SolCallback(sLLFlipper) = "SolLFlipper"
  36.  
  37. Sub SolLFlipper(Enabled)
  38. If Enabled Then
  39. PlaySound SoundFX("fx_Flipperup",DOFFlippers):LeftFlipper.RotateToEnd:LeftFlipper1.RotateToEnd
  40. 'LeftFlipperWall.isdropped = False
  41. Else
  42. PlaySound SoundFX("fx_Flipperdown",DOFFlippers):LeftFlipper.RotateToStart:LeftFlipper1.RotateToStart
  43. 'LeftFlipperWall.isdropped = True
  44. End If
  45. End Sub
  46.  
  47. Sub SolRFlipper(Enabled)
  48. If Enabled Then
  49. PlaySound SoundFX("fx_Flipperup",DOFFlippers):RightFlipper.RotateToEnd:RightFlipper1.RotateToEnd
  50. 'RightFlipperWall.isdropped = False
  51. Else
  52. PlaySound SoundFX("fx_Flipperdown",DOFFlippers):RightFlipper.RotateToStart:RightFlipper1.RotateToStart
  53. 'RightFlipperWall.isdropped = True
  54. End If
  55. End Sub
  56. '**********************************************************************************************************
  57.  
  58. 'Solenoid Controlled toys
  59. '**********************************************************************************************************
  60.  
  61. Dim MovingPFHeight,MovingPFDir,EndPositionReached,MovingPFIsUp, obj
  62.  
  63. Sub MotorRelay(Enabled)
  64. if enabled then
  65. MovingPFDir = -MovingPFDir
  66. EndPositionReached = False
  67. MovingPFMoveTimer.enabled = True
  68.  
  69. else
  70.  
  71. end if
  72. end sub
  73.  
  74. Sub MovingPFMoveTimer_Timer
  75. Playsound "Motor1",0,0.2,0,0.1
  76. MovingPFHeight = MovingPFHeight + MovingPFDir
  77. if (MovingPFHeight >= 99) or (MovingPFHeight <= 0) then
  78. EndPositionReached = True
  79. else
  80. EndPositionReached = False
  81. end if
  82.  
  83. for each obj in MovingPFPrimitives
  84. obj.TransZ = MovingPFHeight
  85. next
  86. P_GateWire.Z = 60 + MovingPFHeight
  87. L15a.BulbHaloHeight = 60 + MovingPFHeight
  88. L15b.BulbHaloHeight = 60 + MovingPFHeight
  89. L15c.BulbHaloHeight = 60 + MovingPFHeight
  90. L15d.BulbHaloHeight = 60 + MovingPFHeight
  91. L15e.BulbHaloHeight = 60 + MovingPFHeight
  92. L15f.BulbHaloHeight = 60 + MovingPFHeight
  93.  
  94. if EndPositionReached then
  95. MovingPFMoveTimer.enabled = False
  96. if MovingPFHeight > 50 then
  97. MovingPFIsUp = True
  98. else
  99. MovingPFIsUp = False
  100. end if
  101.  
  102. Controller.switch(51) = not MovingPFIsUp
  103. for each obj in MovingPFWalls
  104. obj.isdropped = not MovingPFIsUp
  105. next
  106. Gate.collidable = MovingPFIsUp
  107. end if
  108. end sub
  109.  
  110. Sub InitMovingPlayfield
  111. MovingPFHeight = 0
  112. MovingPFIsUp = False
  113. MovingPFDir = -1
  114. EndPositionReached = False
  115. Controller.switch(51) = not MovingPFIsUp
  116. for each obj in MovingPFWalls
  117. obj.isdropped = not MovingPFIsUp
  118. next
  119. Gate.collidable = MovingPFIsUp
  120. End Sub
  121.  
  122. '*****GI Lights On
  123. dim xx
  124. For each xx in GI:xx.State = 1: Next
  125.  
  126.  
  127. '**********************************************************************************************************
  128.  
  129. 'Initiate Table
  130. '**********************************************************************************************************
  131.  
  132. Dim bsTrough, bsKicker, LeftDropTargetBank, RightDropTargetBank
  133.  
  134. Sub Table1_Init
  135. vpmInit Me
  136. On Error Resume Next
  137. With Controller
  138. .GameName = cGameName
  139. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  140. .SplashInfoLine = "TimeMachine (Zaccaria 1983)"&chr(13)&"You Suck"
  141. .HandleMechanics=0
  142. .HandleKeyboard=0
  143. .ShowDMDOnly=1
  144. .ShowFrame=0
  145. .ShowTitle=0
  146. .hidden = 1
  147. On Error Resume Next
  148. .Run GetPlayerHWnd
  149. If Err Then MsgBox Err.Description
  150. On Error Goto 0
  151. End With
  152. On Error Goto 0
  153.  
  154. PinMAMETimer.Interval=PinMAMEInterval
  155. PinMAMETimer.Enabled = true
  156.  
  157. vpmNudge.TiltSwitch=10
  158. vpmNudge.Sensitivity=2
  159. vpmNudge.TiltObj = Array(LeftBumper,RightBumper,CenterBumper,LeftslingShot,RightslingShot)
  160.  
  161. Set bsTrough=New cvpmBallStack
  162. bsTrough.InitSw 0,16,0,0,0,0,0,0
  163. bsTrough.InitKick BallRelease,90,5
  164. bsTrough.InitExitSnd SoundFX("ballrelease",DOFContactors), SoundFX("Solenoid",DOFContactors)
  165. bsTrough.Balls=1
  166.  
  167. Set bsKicker=New cvpmBallStack
  168. bsKicker.InitSaucer sw23,23,170,5
  169. bsKicker.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  170.  
  171. set LeftDropTargetBank = new cvpmDropTarget
  172. LeftDropTargetBank.InitDrop Array(sw24,sw25,sw26), Array(24,25,26)
  173. LeftDropTargetBank.InitSnd SoundFX("DTDrop",DOFDropTargets),SoundFX("DTReset",DOFContactors)
  174.  
  175. set RightDropTargetBank = new cvpmDropTarget
  176. RightDropTargetBank.InitDrop Array(sw27,sw28,sw29), Array(27,28,29)
  177. RightDropTargetBank.InitSnd SoundFX("DTDrop",DOFDropTargets),SoundFX("DTReset",DOFContactors)
  178.  
  179. InitMovingPlayfield
  180. 'LeftFlipperWall.isdropped = 1
  181. 'RightFlipperWall.isdropped = 1
  182.  
  183. End Sub
  184.  
  185. '**********************************************************************************************************
  186. 'Plunger code
  187. '**********************************************************************************************************
  188.  
  189. Sub Table1_KeyDown(ByVal KeyCode)
  190. If keycode = LeftMagnaSave Then bLutActive = True
  191. If keycode = RightMagnaSave Then
  192. If bLutActive Then NextLUT: End If
  193. End If
  194. If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
  195. If KeyDownHandler(keycode) Then Exit Sub
  196. End Sub
  197.  
  198. Sub Table1_KeyUp(ByVal KeyCode)
  199. If keycode = LeftMagnaSave Then bLutActive = False
  200. If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
  201. If KeyUpHandler(keycode) Then Exit Sub
  202. End Sub
  203.  
  204. '**********************************************************************************************************
  205.  
  206. ' Drain hole and kickers
  207. Sub Drain_Hit:bsTrough.addball me : playsound"drain" : End Sub
  208. Sub sw23_Hit:bsKicker.AddBall 0 : playsound "popper_ball": End Sub
  209.  
  210. 'Drop Targets
  211. Sub sw24_Dropped:LeftDropTargetBank.Hit 1:End Sub
  212. Sub sw25_Dropped:LeftDropTargetBank.Hit 2:End Sub
  213. Sub sw26_Dropped:LeftDropTargetBank.Hit 3:End Sub
  214.  
  215. Sub sw27_Dropped:RightDropTargetBank.Hit 1:End Sub
  216. Sub sw28_Dropped:RightDropTargetBank.Hit 2:End Sub
  217. Sub sw29_Dropped:RightDropTargetBank.Hit 3:End Sub
  218.  
  219. 'Button Triggers
  220. sub sw17_hit:Controller.Switch(17)=1 : playsound"rollover" : End Sub
  221. sub sw17_unhit:Controller.Switch(17)=0:End Sub
  222. sub sw20_hit:Controller.Switch(20)=1 : playsound"rollover" : End Sub
  223. sub sw20_unhit:Controller.Switch(20)=0:End Sub
  224.  
  225. 'Wire Triggers
  226. sub sw21_hit:Controller.Switch(21)=1 : playsound"rollover" : End Sub
  227. sub sw21_unhit:Controller.Switch(21)=0:End Sub
  228. sub sw22_hit:Controller.Switch(22)=1 : playsound"rollover" : End Sub
  229. sub sw22_unhit:Controller.Switch(22)=0:End Sub
  230. sub sw39_hit:Controller.Switch(39)=1 : playsound"rollover" : End Sub
  231. sub sw39_unhit:Controller.Switch(39)=0:End Sub
  232.  
  233. 'Ramp Triggers
  234. sub sw30_hit:Controller.Switch(30)=1 : playsound"rollover" : End Sub
  235. sub sw30_unhit:Controller.Switch(30)=0:End Sub
  236. sub sw31_hit:Controller.Switch(31)=1 : playsound"rollover" : End Sub
  237. sub sw31_unhit:Controller.Switch(31)=0:End Sub
  238.  
  239.  
  240. 'Stand Up Targets Moving PF
  241. Sub sw40_hit:vpmTimer.pulseSw 40:sw40.TimerEnabled = 1:sw40p.TransY = 4: playsound SoundFX("Target",DOFTargets) : End Sub
  242. Sub sw40_Timer:sw40p.TransY = 0 : sw40.TimerEnabled = 0 : End Sub
  243. Sub sw41_hit:vpmTimer.pulseSw 41:sw41.TimerEnabled = 1:sw41p.TransY = 4: playsound SoundFX("Target",DOFTargets) : End Sub
  244. Sub sw41_Timer:sw41p.TransY = 0 : sw41.TimerEnabled = 0 : End Sub
  245. Sub sw42_hit:vpmTimer.pulseSw 42:sw42.TimerEnabled = 1:sw42p.TransY = 4: playsound SoundFX("Target",DOFTargets) : End Sub
  246. Sub sw42_Timer:sw42p.TransY = 0 : sw42.TimerEnabled = 0 : End Sub
  247. Sub sw43_hit:vpmTimer.pulseSw 43:sw43.TimerEnabled = 1:sw43p.TransY = 4: playsound SoundFX("Target",DOFTargets) : End Sub
  248. Sub sw43_Timer:sw43p.TransY = 0 : sw43.TimerEnabled = 0 : End Sub
  249. Sub sw44_hit:vpmTimer.pulseSw 44:sw44.TimerEnabled = 1:sw44p.TransY = 4: playsound SoundFX("Target",DOFTargets) : End Sub
  250. Sub sw44_Timer:sw44p.TransY = 0 : sw44.TimerEnabled = 0 : End Sub
  251. Sub sw45_hit:vpmTimer.pulseSw 45:sw45.TimerEnabled = 1:sw45p.TransY = 4: playsound SoundFX("Target",DOFTargets) : End Sub
  252. Sub sw45_Timer:sw45p.TransY = 0 : sw45.TimerEnabled = 0 : End Sub
  253. Sub sw46_hit:vpmTimer.pulseSw 46:sw46.TimerEnabled = 1:sw46p.TransY = 4: playsound SoundFX("Target",DOFTargets) : End Sub
  254. Sub sw46_Timer:sw46p.TransY = 0: : sw46.TimerEnabled = 0 : End Sub
  255. Sub sw47_hit:vpmTimer.pulseSw 47:sw47.TimerEnabled = 1:sw47p.TransY = 4: playsound SoundFX("Target",DOFTargets) : End Sub
  256. Sub sw47_Timer:sw47p.TransY = 0 : sw47.TimerEnabled = 0 : End Sub
  257.  
  258. 'Stand Up Targets
  259. Sub sw32_hit:vpmTimer.pulseSw 32 : DOF 102, DOFPulse : End Sub
  260. Sub sw32a_hit:vpmTimer.pulseSw 32 : DOF 101, DOFPulse : End Sub
  261. Sub sw33_hit:vpmTimer.pulseSw 33 : End Sub
  262. Sub sw34_hit:vpmTimer.pulseSw 34 : End Sub
  263. Sub sw35_hit:vpmTimer.pulseSw 35 : End Sub
  264. Sub sw36_hit:vpmTimer.pulseSw 36 : End Sub
  265. Sub sw37_hit:vpmTimer.pulseSw 37 : End Sub
  266. Sub sw38_hit:vpmTimer.pulseSw 38 : End Sub
  267.  
  268.  
  269. 'Bumpers
  270. Sub CenterBumper_slingshot
  271. vpmTimer.PulseSw 48
  272. playsound SoundFX("fx_bumper1",DOFContactors)
  273. End Sub
  274.  
  275. Sub RightBumper_slingshot
  276. vpmTimer.PulseSw 49
  277. playsound SoundFX("fx_bumper1",DOFContactors)
  278. End Sub
  279.  
  280. Sub LeftBumper_slingshot
  281. vpmTimer.PulseSw 50
  282. playsound SoundFX("fx_bumper1",DOFContactors)
  283. End Sub
  284.  
  285. 'Generic Sounds
  286. Sub Trigger1_Hit:PlaySound "Wire Ramp":End Sub
  287. Sub Trigger2_Hit:PlaySound "Metal_Scoop":StopSound "Wire Ramp":End Sub
  288.  
  289.  
  290. '***************************************************
  291. 'Left Wire Ramp animation
  292. '***************************************************
  293.  
  294. Dim WireRamp_Dir
  295.  
  296. Sub WireRamp_Enter_Hit
  297. WireRamp_Dir = -1
  298. WireRampTimer.enabled = False
  299. WireRampTimer.enabled = True
  300. End Sub
  301.  
  302. Sub WireRamp_Exit_Hit
  303. WireRamp_Dir = 1
  304. WireRampTimer.enabled = False
  305. WireRampTimer.enabled = True
  306. PlaySound "fx_ballrampdrop"
  307. End Sub
  308.  
  309. Sub WireRampTimer_Timer
  310. P_WireRamp.ObjRotX = P_WireRamp.ObjRotX + WireRamp_Dir
  311. if P_WireRamp.ObjRotX <= -15 then
  312. WireRampTimer.enabled = False
  313. WireRamp_Dir = 0
  314. end if
  315. if P_WireRamp.ObjRotX >= 5 then
  316. WireRampTimer.enabled = False
  317. P_WireRamp.ObjRotX = 5
  318. WireRamp_Dir = 0
  319. end if
  320. End Sub
  321.  
  322. '***************************************************
  323.  
  324. '***************************************************
  325. ' JP's VP10 Fading Lamps & Flashers
  326. ' Based on PD's Fading Light System
  327. ' SetLamp 0 is Off
  328. ' SetLamp 1 is On
  329. ' fading for non opacity objects is 4 steps
  330. '***************************************************
  331.  
  332. Dim LampState(200), FadingLevel(200)
  333. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  334.  
  335. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  336. LampTimer.Interval = 5 'lamp fading speed
  337. LampTimer.Enabled = 1
  338.  
  339. ' Lamp & Flasher Timers
  340.  
  341. Sub LampTimer_Timer()
  342. Dim chgLamp, num, chg, ii
  343. chgLamp = Controller.ChangedLamps
  344. If Not IsEmpty(chgLamp) Then
  345. For ii = 0 To UBound(chgLamp)
  346. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  347. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  348.  
  349. 'Special Handling
  350. 'If chgLamp(ii,0) = 2 Then solTrough chgLamp(ii,1)
  351. 'If chgLamp(ii,0) = 4 Then PFGI chgLamp(ii,1)
  352.  
  353. Next
  354. End If
  355. UpdateLamps
  356. End Sub
  357.  
  358.  
  359. Sub UpdateLamps()
  360. NFadeL 1, Lamp1 'GI bulb
  361.  
  362. NFadeL 2, Lamp2
  363. NFadeL 3, Lamp3
  364. NFadeL 4, Lamp4
  365. NFadeL 5, Lamp5
  366. NFadeL 8, Lamp8
  367. NFadeL 9, Lamp9
  368. NFadeLm 10, Lamp10
  369. NFadeL 10, Lamp10a
  370. NFadeLm 11, Lamp11
  371. NFadeL 11, Lamp11a
  372. NFadeLm 14, L14 'GI bulb
  373. NFadeL 14, L14a
  374.  
  375. NFadeLm 15, L15a 'Bumpers
  376. NFadeLm 15, L15b
  377. NFadeLm 15, L15c
  378. NFadeLm 15, L15d
  379. NFadeLm 15, L15e
  380. NFadeL 15, L15f
  381.  
  382.  
  383. NFadeLm 16, L16 'GI bulb
  384. NFadeL 16, L16a
  385. NFadeLm 18, L18 'GI bulb
  386. NFadeL 18, L18a
  387. NFadeLm 19, L19 'GI bulb
  388. NFadeL 19, L19a
  389. 'NFadeL 20, Lamp20 'flipper
  390. NFadeLm 21, L21 'GI bulb
  391. NFadeL 21, L21a
  392. NFadeL 22, Lamp22
  393. NFadeL 23, Lamp23
  394. NFadeL 24, Lamp24
  395. NFadeL 25, Lamp25
  396. NFadeL 26, Lamp26
  397. NFadeObjm 27, P27, "RedApronLight_lit", "RedApronLight"
  398. NFadeL 27, Lamp27 'Apron
  399. NFadeL 28, Lamp28
  400. NFadeL 29, Lamp29
  401. NFadeL 30, Lamp30
  402. NFadeL 32, Lamp32
  403. NFadeL 33, Lamp33
  404. NFadeL 34, Lamp34
  405. NFadeL 35, Lamp35
  406. NFadeL 36, Lamp36
  407. NFadeL 38, Lamp38
  408. NFadeL 39, Lamp39
  409. NFadeL 40, Lamp40
  410. NFadeL 41, Lamp41
  411. NFadeL 42, Lamp42
  412. NFadeL 43, Lamp43
  413. NFadeL 44, Lamp44
  414. NFadeL 45, Lamp45
  415. NFadeL 46, Lamp46
  416. NFadeL 47, Lamp47
  417. NFadeL 48, Lamp48
  418. NFadeL 49, Lamp49
  419. NFadeL 50, Lamp50
  420. NFadeL 51, Lamp51
  421. NFadeL 52, Lamp52
  422. NFadeL 53, Lamp53
  423. NFadeL 54, Lamp54
  424. NFadeL 55, Lamp55
  425. NFadeL 57, Lamp57
  426. NFadeL 58, Lamp58
  427. NFadeL 59, Lamp59
  428. NFadeL 61, Lamp61
  429. NFadeL 63, Lamp63
  430. NFadeL 64, Lamp64
  431. NFadeL 65, Lamp65
  432. NFadeL 68, Lamp68
  433. NFadeL 69, Lamp69
  434. NFadeL 70, Lamp70
  435. NFadeObj 71, P71, "Light_A_lit", "Light_A_unlit" 'Moving PF
  436. NFadeObj 73, P73, "Light_B_lit", "Light_B_unlit" 'Moving PF
  437. NFadeObj 74, P74, "Light_C_lit", "Light_C_unlit" 'Moving PF
  438. NFadeObj 75, P75, "Light_D_lit", "Light_D_unlit" 'Moving PF
  439. NFadeObj 79, P79, "Light_E_lit", "Light_E_unlit" 'Moving PF
  440. NFadeObj 80, P80, "Light_F_lit", "Light_F_unlit" 'Moving PF
  441.  
  442. End Sub
  443.  
  444.  
  445. ' div lamp subs
  446.  
  447. Sub InitLamps()
  448. Dim x
  449. For x = 0 to 200
  450. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  451. FadingLevel(x) = 4 ' used to track the fading state
  452. FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
  453. FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
  454. FlashMax(x) = 1 ' the maximum value when on, usually 1
  455. FlashMin(x) = 0 ' the minimum value when off, usually 0
  456. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  457. Next
  458. End Sub
  459.  
  460. Sub AllLampsOff
  461. Dim x
  462. For x = 0 to 200
  463. SetLamp x, 0
  464. Next
  465. End Sub
  466.  
  467. Sub SetLamp(nr, value)
  468. If value <> LampState(nr) Then
  469. LampState(nr) = abs(value)
  470. FadingLevel(nr) = abs(value) + 4
  471. End If
  472. End Sub
  473.  
  474. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  475.  
  476. Sub NFadeL(nr, object)
  477. Select Case FadingLevel(nr)
  478. Case 4:object.state = 0:FadingLevel(nr) = 0
  479. Case 5:object.state = 1:FadingLevel(nr) = 1
  480. End Select
  481. End Sub
  482.  
  483. Sub NFadeLm(nr, object) ' used for multiple lights
  484. Select Case FadingLevel(nr)
  485. Case 4:object.state = 0
  486. Case 5:object.state = 1
  487. End Select
  488. End Sub
  489.  
  490. 'Lights, Ramps & Primitives used as 4 step fading lights
  491. 'a,b,c,d are the images used from on to off
  492.  
  493. Sub FadeObj(nr, object, a, b, c, d)
  494. Select Case FadingLevel(nr)
  495. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  496. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  497. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  498. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  499. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  500. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  501. End Select
  502. End Sub
  503.  
  504. Sub FadeObjm(nr, object, a, b, c, d)
  505. Select Case FadingLevel(nr)
  506. Case 4:object.image = b
  507. Case 5:object.image = a
  508. Case 9:object.image = c
  509. Case 13:object.image = d
  510. End Select
  511. End Sub
  512.  
  513. Sub NFadeObj(nr, object, a, b)
  514. Select Case FadingLevel(nr)
  515. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  516. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  517. End Select
  518. End Sub
  519.  
  520. Sub NFadeObjm(nr, object, a, b)
  521. Select Case FadingLevel(nr)
  522. Case 4:object.image = b
  523. Case 5:object.image = a
  524. End Select
  525. End Sub
  526.  
  527. ' Flasher objects
  528.  
  529. Sub Flash(nr, object)
  530. Select Case FadingLevel(nr)
  531. Case 4 'off
  532. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  533. If FlashLevel(nr) < FlashMin(nr) Then
  534. FlashLevel(nr) = FlashMin(nr)
  535. FadingLevel(nr) = 0 'completely off
  536. End if
  537. Object.IntensityScale = FlashLevel(nr)
  538. Case 5 ' on
  539. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  540. If FlashLevel(nr) > FlashMax(nr) Then
  541. FlashLevel(nr) = FlashMax(nr)
  542. FadingLevel(nr) = 1 'completely on
  543. End if
  544. Object.IntensityScale = FlashLevel(nr)
  545. End Select
  546. End Sub
  547.  
  548. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  549. Object.IntensityScale = FlashLevel(nr)
  550. End Sub
  551.  
  552.  
  553. '**********************************************************************************************************
  554. 'Digital Display
  555. '**********************************************************************************************************
  556. Dim Digits(40)
  557.  
  558. Digits(0) = Array(LED10,LED11,LED12,LED13,LED14,LED15,LED16)
  559. Digits(1) = Array(LED20,LED21,LED22,LED23,LED24,LED25,LED26)
  560. Digits(2) = Array(LED30,LED31,LED32,LED33,LED34,LED35,LED36)
  561. Digits(3) = Array(LED40,LED41,LED42,LED43,LED44,LED45,LED46)
  562. Digits(4) = Array(LED50,LED51,LED52,LED53,LED54,LED55,LED56)
  563. Digits(5) = Array(LED60,LED61,LED62,LED63,LED64,LED65,LED66)
  564. Digits(6) = Array(LED70,LED71,LED72,LED73,LED74,LED75,LED76)
  565. Digits(7) = Array(LED80,LED81,LED82,LED83,LED84,LED85,LED86)
  566. Digits(8) = Array(LED90,LED91,LED92,LED93,LED94,LED95,LED96)
  567. Digits(9) = Array(LED100,LED101,LED102,LED103,LED104,LED105,LED106)
  568. Digits(10) = Array(LED110,LED111,LED112,LED113,LED114,LED115,LED116)
  569. Digits(11) = Array(LED120,LED121,LED122,LED123,LED124,LED125,LED126)
  570. Digits(12) = Array(LED130,LED131,LED132,LED133,LED134,LED135,LED136)
  571. Digits(13) = Array(LED140,LED141,LED142,LED143,LED144,LED145,LED146)
  572. Digits(14) = Array(LED150,LED151,LED152,LED153,LED154,LED155,LED156)
  573. Digits(15) = Array(LED160,LED161,LED162,LED163,LED164,LED165,LED166)
  574. Digits(16) = Array(LED170,LED171,LED172,LED173,LED174,LED175,LED176)
  575. Digits(17) = Array(LED180,LED181,LED182,LED183,LED184,LED185,LED186)
  576. Digits(18) = Array(LED190,LED191,LED192,LED193,LED194,LED195,LED196)
  577. Digits(19) = Array(LED200,LED201,LED202,LED203,LED204,LED205,LED206)
  578. Digits(20) = Array(LED210,LED211,LED212,LED213,LED214,LED215,LED216)
  579. Digits(21) = Array(LED220,LED221,LED222,LED223,LED224,LED225,LED226)
  580. Digits(22) = Array(LED230,LED231,LED232,LED233,LED234,LED235,LED236)
  581. Digits(23) = Array(LED240,LED241,LED242,LED243,LED244,LED245,LED246)
  582. Digits(24) = Array(LED250,LED251,LED252,LED253,LED254,LED255,LED256)
  583. Digits(25) = Array(LED260,LED261,LED262,LED263,LED264,LED265,LED266)
  584. Digits(26) = Array(LED270,LED271,LED272,LED273,LED274,LED275,LED276)
  585. Digits(27) = Array(LED280,LED281,LED282,LED283,LED284,LED285,LED286)
  586. Digits(28) = Array(LED4,LED2,LED6,LED7,LED5,LED1,LED3)
  587. Digits(29) = Array(LED18,LED9,LED27,LED28,LED19,LED8,LED17)
  588. Digits(30) = Array(LED39,LED37,LED48,LED49,LED47,LED29,LED38)
  589. Digits(31) = Array(LED67,LED58,LED69,LED77,LED68,LED57,LED59)
  590. Digits(32) = Array(LED88,LED79,LED97,LED98,LED89,LED78,LED87)
  591. Digits(33) = Array(LED109,LED107,LED118,LED119,LED117,LED99,LED108)
  592. Digits(34) = Array(LED137,LED128,LED139,LED147,LED138,LED127,LED129)
  593. Digits(35) = Array(LED158,LED149,LED167,LED168,LED159,LED148,LED157)
  594. Digits(36) = Array(LED179,LED177,LED188,LED189,LED187,LED169,LED178)
  595. Digits(37) = Array(LED207,LED198,LED209,LED217,LED208,LED197,LED199)
  596. Digits(38) = Array(LED228,LED219,LED237,LED238,LED229,LED218,LED227)
  597. Digits(39) = Array(LED249,LED247,LED258,LED259,LED257,LED239,LED248)
  598.  
  599. Sub DisplayTimer_Timer
  600. Dim ChgLED,ii,num,chg,stat,obj
  601. ChgLed = Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
  602. If Not IsEmpty(ChgLED) Then
  603. If DesktopMode = True Then
  604. For ii = 0 To UBound(chgLED)
  605. num = chgLED(ii, 0) : chg = chgLED(ii, 1) : stat = chgLED(ii, 2)
  606. if (num < 40) then
  607. For Each obj In Digits(num)
  608. If chg And 1 Then obj.State = stat And 1
  609. chg = chg\2 : stat = stat\2
  610. Next
  611. else
  612.  
  613. end if
  614. next
  615. end if
  616. end if
  617. End Sub
  618.  
  619.  
  620. '**********************************************************************************************************
  621. '**********************************************************************************************************
  622.  
  623. '**********Sling Shot Animations
  624. ' Rstep and Lstep are the variables that increment the animation
  625. '****************
  626. Dim RStep, Lstep
  627.  
  628. Sub RightSlingShot_Slingshot
  629. vpmTimer.PulseSw 19
  630. PlaySound SoundFX("right_slingshot",DOFContactors), 0,1, 0.05,0.05 '0,1, AudioPan(RightSlingShot), 0.05,0,0,1,AudioFade(RightSlingShot)
  631. RSling.Visible = 0
  632. RSling1.Visible = 1
  633. sling1.rotx = 20
  634. RStep = 0
  635. RightSlingShot.TimerEnabled = 1
  636. End Sub
  637.  
  638. Sub RightSlingShot_Timer
  639. Select Case RStep
  640. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.rotx = 10
  641. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.rotx = 0:RightSlingShot.TimerEnabled = 0:
  642. End Select
  643. RStep = RStep + 1
  644. End Sub
  645.  
  646. Sub LeftSlingShot_Slingshot
  647. vpmTimer.PulseSw 18
  648. PlaySound SoundFX("left_slingshot",DOFContactors), 0,1, -0.05,0.05 '0,1, AudioPan(LeftSlingShot), 0.05,0,0,1,AudioFade(LeftSlingShot)
  649. LSling.Visible = 0
  650. LSling1.Visible = 1
  651. sling2.rotx = 20
  652. LStep = 0
  653. LeftSlingShot.TimerEnabled = 1
  654. End Sub
  655.  
  656. Sub LeftSlingShot_Timer
  657. Select Case LStep
  658. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.rotx = 10
  659. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.rotx = 0:LeftSlingShot.TimerEnabled = 0:
  660. End Select
  661. LStep = LStep + 1
  662. End Sub
  663.  
  664.  
  665. '*********************************************************************
  666. ' Positional Sound Playback Functions
  667. '*********************************************************************
  668.  
  669. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  670. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  671. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  672. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  673. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  674. End Sub
  675.  
  676. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  677. Sub PlaySoundAt(soundname, tableobj)
  678. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  679. End Sub
  680.  
  681. Sub PlaySoundAtBall(soundname)
  682. PlaySoundAt soundname, ActiveBall
  683. End Sub
  684.  
  685. '*************
  686. ' JP'S LUT
  687. '*************
  688.  
  689. Dim bLutActive, LUTImage
  690. Sub LoadLUT
  691. Dim x
  692. x = LoadValue(cGameName, "LUTImage")
  693. If(x <> "") Then LUTImage = x Else LUTImage = 0
  694. UpdateLUT
  695. End Sub
  696.  
  697. Sub SaveLUT
  698. SaveValue cGameName, "LUTImage", LUTImage
  699. End Sub
  700.  
  701. Sub NextLUT: LUTImage = (LUTImage +1 ) MOD 10: UpdateLUT: SaveLUT: End Sub
  702.  
  703. Sub UpdateLUT
  704. Select Case LutImage
  705. Case 0: table1.ColorGradeImage = "LUT0"
  706. Case 1: table1.ColorGradeImage = "LUT1"
  707. Case 2: table1.ColorGradeImage = "LUT2"
  708. Case 3: table1.ColorGradeImage = "LUT3"
  709. Case 4: table1.ColorGradeImage = "LUT4"
  710. Case 5: table1.ColorGradeImage = "LUT5"
  711. Case 6: table1.ColorGradeImage = "LUT6"
  712. Case 7: table1.ColorGradeImage = "LUT7"
  713. Case 8: table1.ColorGradeImage = "LUT8"
  714. Case 9: table1.ColorGradeImage = "LUT9"
  715.  
  716. End Select
  717. End Sub
  718.  
  719. '*********************************************************************
  720. ' Positional Sound Playback Functions
  721. '*********************************************************************
  722.  
  723. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  724. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  725. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  726. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  727. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  728. End Sub
  729.  
  730. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  731. Sub PlaySoundAt(soundname, tableobj)
  732. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  733. End Sub
  734.  
  735. Sub PlaySoundAtBall(soundname)
  736. PlaySoundAt soundname, ActiveBall
  737. End Sub
  738.  
  739.  
  740. '*********************************************************************
  741. ' Supporting Ball & Sound Functions
  742. '*********************************************************************
  743.  
  744. Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
  745. Dim tmp
  746. tmp = tableobj.y * 2 / table1.height-1
  747. If tmp > 0 Then
  748. AudioFade = Csng(tmp ^10)
  749. Else
  750. AudioFade = Csng(-((- tmp) ^10) )
  751. End If
  752. End Function
  753.  
  754. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  755. Dim tmp
  756. tmp = tableobj.x * 2 / table1.width-1
  757. If tmp > 0 Then
  758. AudioPan = Csng(tmp ^10)
  759. Else
  760. AudioPan = Csng(-((- tmp) ^10) )
  761. End If
  762. End Function
  763.  
  764. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  765. Vol = Csng(BallVel(ball) ^2 / 2000)
  766. End Function
  767.  
  768. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  769. Pitch = BallVel(ball) * 20
  770. End Function
  771.  
  772. Function BallVel(ball) 'Calculates the ball speed
  773. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  774. End Function
  775.  
  776.  
  777. '********************************************************************
  778. ' JP's VP10 Rolling Sounds (+rothbauerw's Dropping Sounds)
  779. '********************************************************************
  780.  
  781. Const tnob = 5 ' total number of balls
  782. ReDim rolling(tnob)
  783. InitRolling
  784.  
  785. Sub InitRolling
  786. Dim i
  787. For i = 0 to tnob
  788. rolling(i) = False
  789. Next
  790. End Sub
  791.  
  792. Sub RollingTimer_Timer()
  793. Dim BOT, b
  794. BOT = GetBalls
  795.  
  796. ' stop the sound of deleted balls
  797. For b = UBound(BOT) + 1 to tnob
  798. rolling(b) = False
  799. StopSound "fx_ballrolling" & b
  800. StopSound "fx_plasticrolling" & b
  801. StopSound "fx_metalrolling" & b
  802. Next
  803.  
  804. ' exit the sub if no balls on the table
  805. If UBound(BOT) = -1 Then Exit Sub
  806.  
  807. ' play the rolling sound for each ball
  808. For b = 0 to UBound(BOT)
  809. If BallVel(BOT(b) ) > 1 Then
  810. rolling(b) = True
  811. If BOT(b).Z > 30 Then
  812. ' ball on plastic ramp
  813. StopSound "fx_ballrolling" & b
  814. StopSound "fx_metalrolling" & b
  815. PlaySound "fx_plasticrolling" & b, -1, Vol(BOT(b)) / 2, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  816. Else
  817. ' ball on playfield
  818. StopSound "fx_plasticrolling" & b
  819. StopSound "fx_metalrolling" & b
  820. PlaySound "fx_ballrolling" & b, -1, Vol(BOT(b)) / 2, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  821. End If
  822. Else
  823. If rolling(b) Then
  824. StopSound "fx_ballrolling" & b
  825. StopSound "fx_plasticrolling" & b
  826. StopSound "fx_metalrolling" & b
  827. rolling(b) = False
  828. End If
  829. End If
  830.  
  831. ' ball drop sounds matching the adjusted height params but not the way down the ramps
  832. If BOT(b).VelZ < -1 And BOT(b).Z < 55 And BOT(b).Z > 27 then 'And Not InRect(BOT(b).X, BOT(b).Y, 610,320, 740,320, 740,550, 610,550) And Not InRect(BOT(b).X, BOT(b).Y, 180,400, 230,400, 230, 550, 180,550) Then
  833. PlaySound "fx_ball_drop" & Int(Rnd()*3), 0, ABS(BOT(b).VelZ)/17*5, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  834. End If
  835.  
  836. Next
  837. End Sub
  838.  
  839. '**********************
  840. ' Ball Collision Sound
  841. '**********************
  842.  
  843. Sub OnBallBallCollision(ball1, ball2, velocity)
  844. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  845. End Sub
  846.  
  847.  
  848.  
  849. '*****************************************
  850. ' ninuzzu's FLIPPER SHADOWS
  851. '*****************************************
  852.  
  853. sub FlipperTimer_Timer()
  854. FlipperLSh.RotZ = LeftFlipper.currentangle
  855. FlipperRSh.RotZ = RightFlipper.currentangle
  856. FlipperLSh1.RotZ = LeftFlipper1.currentangle-15
  857. FlipperRSh1.RotZ = RightFlipper1.currentangle+15
  858.  
  859. FlipperT1.Roty = FlipperLSh1.RotZ + 240
  860. FlipperT2.Roty = FlipperRSh1.RotZ - 240
  861. FlipperT3.Roty = FlipperLSh1.RotZ + 240
  862. FlipperT4.Roty = FlipperRSh1.RotZ - 240
  863.  
  864. P_LeftFlipperWing.RotZ = FlipperLSh1.RotZ + 250
  865. P_RightFlipperWing.RotZ = FlipperRSh1.RotZ - 250
  866.  
  867. End Sub
  868.  
  869. '*****************************************
  870. ' ninuzzu's BALL SHADOW
  871. '*****************************************
  872. Dim BallShadow
  873. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  874.  
  875. dim ShadowRadiusLimit, BallDistance
  876. ShadowRadiusLimit = 588 / 2 + Ballsize*2 ' 588 is the diameter of the moving playfield
  877.  
  878. Sub BallShadowUpdate_timer()
  879. Dim BOT, b
  880. BOT = GetBalls
  881. ' hide shadow of deleted balls
  882. If UBound(BOT)<(tnob-1) Then
  883. For b = (UBound(BOT) + 1) to (tnob-1)
  884. BallShadow(b).visible = 0
  885. Next
  886. End If
  887. ' exit the Sub if no balls on the table
  888. If UBound(BOT) = -1 Then Exit Sub
  889. ' render the shadow for each ball
  890. For b = 0 to UBound(BOT)
  891.  
  892. 'If BOT(b).X < Table1.Width/2 Then
  893. ' BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/21)) + 6
  894. 'Else
  895. ' BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/21)) - 6
  896. 'End If
  897.  
  898. BallShadow(b).X = (BOT(b).X)
  899. ballShadow(b).Y = BOT(b).Y + 12
  900. ballShadow(b).Z = BOT(b).Z - Ballsize' / 2
  901.  
  902. BallDistance=Sqr(((ballShadow(b).X-Primitive98.X)^2)+((ballShadow(b).Y-Primitive98.Y)^2))
  903. If ((BallDistance> ShadowRadiusLimit) Or (MovingPFIsUp)) And (ballShadow(b).Z > 0) then
  904. BallShadow(b).visible = 1
  905. Else
  906. BallShadow(b).visible = 0
  907. End If
  908. Next
  909. End Sub
  910.  
  911.  
  912.  
  913. '************************************
  914. ' What you need to add to your table
  915. '************************************
  916.  
  917. ' a timer called RollingTimer. With a fast interval, like 10
  918. ' one collision sound, in this script is called fx_collide
  919. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  920. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  921.  
  922.  
  923. '******************************************
  924. ' Explanation of the rolling sound routine
  925. '******************************************
  926.  
  927. ' sounds are played based on the ball speed and position
  928.  
  929. ' the routine checks first for deleted balls and stops the rolling sound.
  930.  
  931. ' The For loop goes through all the balls on the table and checks for the ball speed and
  932. ' if the ball is on the table (height lower than 30) then then it plays the sound
  933. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  934.  
  935. ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
  936. ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
  937. ' according to the position of the ball on the table.
  938.  
  939.  
  940. '**************************************
  941. ' Explanation of the collision routine
  942. '**************************************
  943.  
  944. ' The collision is built in VP.
  945. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  946. ' will call this routine. What you add in the sub is up to you. As an example is a simple Playsound with volume and paning
  947. ' depending of the speed of the collision.
  948.  
  949.  
  950. Sub Pins_Hit (idx)
  951. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  952. End Sub
  953.  
  954. Sub Targets_Hit (idx)
  955. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  956. End Sub
  957.  
  958. Sub Metals_Thin_Hit (idx)
  959. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  960. End Sub
  961.  
  962. Sub Metals_Medium_Hit (idx)
  963. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  964. End Sub
  965.  
  966. Sub Metals2_Hit (idx)
  967. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  968. End Sub
  969.  
  970. Sub Gates_Hit (idx)
  971. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  972. End Sub
  973.  
  974. Sub Spinner_Spin
  975. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  976. End Sub
  977.  
  978. Sub Rubbers_Hit(idx)
  979. dim finalspeed
  980. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  981. If finalspeed > 20 then
  982. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  983. End if
  984. If finalspeed >= 6 AND finalspeed <= 20 then
  985. RandomSoundRubber()
  986. End If
  987. End Sub
  988.  
  989. Sub Posts_Hit(idx)
  990. dim finalspeed
  991. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  992. If finalspeed > 16 then
  993. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  994. End if
  995. If finalspeed >= 6 AND finalspeed <= 16 then
  996. RandomSoundRubber()
  997. End If
  998. End Sub
  999.  
  1000. Sub RandomSoundRubber()
  1001. Select Case Int(Rnd*3)+1
  1002. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1003. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1004. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1005. End Select
  1006. End Sub
  1007.  
  1008. Sub LeftFlipper_Collide(parm)
  1009. RandomSoundFlipper()
  1010. End Sub
  1011.  
  1012. Sub RightFlipper_Collide(parm)
  1013. RandomSoundFlipper()
  1014. End Sub
  1015.  
  1016. Sub RandomSoundFlipper()
  1017. Select Case Int(Rnd*3)+1
  1018. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1019. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1020. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1021. End Select
  1022. End Sub
  1023.  
  1024.  
  1025. Sub LNailWall_Hit()
  1026. Metals_Thin_Hit(1)
  1027. End Sub
  1028.  
  1029. Sub RNailWall_Hit()
  1030. Metals_Thin_Hit(1)
  1031. End Sub
  1032.  
  1033. Sub Nail001_Hit()
  1034. Metals_Thin_Hit(1)
  1035. End Sub
Add Comment
Please, Sign In to add comment