Outhere

Gay 90's hauntfreaks(Williams 1970) BD HF mod_1.0.1

Sep 9th, 2021
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.94 KB | None | 0 0
  1. 'DOF updated by outhere
  2. '101 Left Flipper
  3. '102 Right Flipper
  4. '103 left slingshot
  5. '104
  6. '105 right slingshot
  7. '106
  8. '107 left bumper
  9. '108 Center bumper
  10. '109 Right Bumper
  11. '110 ballrelease
  12. '111 Drop Target Reset
  13. '112 Upper left bumper
  14. '113 Upper Right Bumper
  15. '118 Kicker2
  16. '120 Kicker1
  17. '121
  18.  
  19. Dim Score(4)
  20. dim truesc(4)
  21. dim reel(5)
  22. dim ballrelenabled
  23. dim state
  24. dim playno
  25. dim credit
  26. dim eg
  27. dim currpl
  28. dim plno(4)
  29. dim play(4)
  30. dim rst
  31. dim ballinplay
  32. dim match(10)
  33. dim tilt
  34. dim tiltsens
  35. dim rep(4)
  36. dim plm(4)
  37. dim matchnumb
  38. dim scn
  39. dim scn1
  40. dim bell
  41. dim points
  42. dim tempscore
  43. dim replay1
  44. dim replay2
  45. dim replay3
  46. dim hisc
  47. dim up(4)
  48. dim hv
  49. dim wv
  50. dim laf
  51. dim target4X
  52. dim i
  53. dim movetarget
  54. dim movedirection
  55. dim kickstep
  56. dim rdwastep, rdwbstep, rdwcstep, rdwdstep, rdwestep
  57.  
  58. Dim B2SOn
  59. Dim controller
  60.  
  61.  
  62.  
  63. ' Load the core.vbs for supporting Subs and functions
  64. LoadCoreFiles
  65.  
  66. Sub LoadCoreFiles
  67. On Error Resume Next
  68. ExecuteGlobal GetTextFile("core.vbs")
  69. If Err Then MsgBox "Can't open core.vbs"
  70. ExecuteGlobal GetTextFile("controller.vbs")
  71. If Err Then MsgBox "Can't open controller.vbs"
  72. On Error Goto 0
  73. End Sub
  74.  
  75. Const cGameName = "gay90s_1970"
  76.  
  77.  
  78. sub MovingTargetTimer_timer
  79. if movedirection=1 Then
  80. Collection2(movetarget).visible=0
  81. Collection2(movetarget).collidable=False
  82. Collection2(movetarget).hashitevent=False
  83. movetarget=movetarget+1
  84. ' Collection2(movetarget).visible=1
  85. Collection2(movetarget).collidable=True
  86. Collection2(movetarget).hashitevent=True
  87.  
  88. if movetarget>48 then
  89. movedirection=0
  90. end If
  91. PtargetC.objroty=((movetarget*.8)-20.5)*-1
  92. exit sub
  93. Else
  94. Collection2(movetarget).Visible=0
  95. Collection2(movetarget).collidable=False
  96. Collection2(movetarget).hashitevent=False
  97.  
  98. movetarget=movetarget-1
  99. ' Collection2(movetarget).visible=1
  100. Collection2(movetarget).collidable=True
  101. Collection2(movetarget).hashitevent=True
  102.  
  103. if movetarget<1 then
  104. movedirection=1
  105. end If
  106. end If
  107. PtargetC.objroty=((movetarget*.8)-20.5)*-1
  108. end sub
  109.  
  110.  
  111. sub table1_init
  112. If ShowDT=false Then
  113. for each obj in DesktopItems
  114. obj.visible=False
  115. Next
  116. end If
  117. for i = 0 to 49
  118. Collection2(i).Visible=0
  119. Collection2(i).collidable=false
  120. Collection2(i).hashitevent=False
  121. Next
  122. ' CenterT50.Visible=1
  123. CenterT50.Collidable=True
  124. CenterT50.Hashitevent=True
  125.  
  126. movetarget=0
  127. movetargetup=0
  128. movetargetupcount=0
  129. movedirection=1
  130. MovingTargetTimer.enabled=false
  131. PtargetC.objroty=((movetarget*.8)-20.5)*-1
  132. StopperFlip.rotatetoend
  133. wv=0
  134. hv=0
  135. targetsdown=0
  136. set play(1)=up1
  137. set play(2)=up2
  138. set play(3)=up3
  139. set play(4)=up4
  140. set match(0)=m0
  141. set match(1)=m1
  142. set match(2)=m2
  143. set match(3)=m3
  144. set match(4)=m4
  145. set match(5)=m5
  146. set match(6)=m6
  147. set match(7)=m7
  148. set match(8)=m8
  149. set match(9)=m9
  150. set up(1)=up1
  151. set up(2)=up2
  152. set up(3)=up3
  153. set up(4)=up4
  154. set reel(1)=reel1
  155. set reel(2)=reel2
  156. set reel(3)=reel3
  157. set reel(4)=reel4
  158. set reel(5)=reel5
  159. replay1=5000
  160. replay2=7400
  161. replay3=9800
  162. loadhs
  163. if hisc="" then hisc=1000
  164. reel5.setvalue(hisc)
  165. if credit="" then credit=0
  166. credittxt.text=credit
  167. if matchnumb="" then matchnumb=int(rnd(1)*9)
  168. select case(matchnumb)
  169. case 0:
  170. m0.text="0"
  171. case 1:
  172. m1.text="1"
  173. case 2:
  174. m2.text="2"
  175. case 3:
  176. m3.text="3"
  177. case 4:
  178. m4.text="4"
  179. case 5:
  180. m5.text="5"
  181. case 6:
  182. m6.text="6"
  183. case 7:
  184. m7.text="7"
  185. case 8:
  186. m8.text="8"
  187. case 9:
  188. m9.text="9"
  189. end select
  190. for i=1 to 4
  191. currpl=i
  192. reel(i).setvalue(score(i))
  193. next
  194. currpl=0
  195. B2SOn=True
  196. if B2SOn then
  197. Set Controller = CreateObject("B2S.Server")
  198. Controller.B2SName = "Gay90s_1970"
  199. Controller.Run()
  200. If Err Then MsgBox "Can't Load B2S.Server."
  201. end if
  202. If B2SOn Then
  203.  
  204. if matchnumb=0 then
  205. Controller.B2SSetMatch 10
  206. else
  207. Controller.B2SSetMatch matchnumb
  208. end if
  209. Controller.B2SSetScoreRolloverPlayer1 0
  210. Controller.B2SSetScoreRolloverPlayer2 0
  211. Controller.B2SSetScoreRolloverPlayer3 0
  212. Controller.B2SSetScoreRolloverPlayer4 0
  213. Controller.B2SSetShootAgain 0
  214. Controller.B2SSetTilt 1
  215. Controller.B2SSetCredits Credit
  216. Controller.B2SSetGameOver 1
  217. Controller.B2SSetData 81,0
  218. Controller.B2SSetData 82,0
  219. Controller.B2SSetData 83,0
  220. Controller.B2SSetData 84,0
  221. End If
  222. for i=1 to 4
  223. If B2SOn Then
  224. Controller.B2SSetScorePlayer i, 0
  225. End If
  226. next
  227. LoadEM
  228. end sub
  229.  
  230.  
  231. Sub Table1_KeyDown(ByVal keycode)
  232.  
  233. If keycode = PlungerKey Then
  234. Plunger.PullBack
  235. End If
  236.  
  237. if keycode = AddCreditKey then
  238. playsound "coin3"
  239. coindelay.enabled=true
  240. credit=credit+4
  241. savehs
  242. If B2SOn Then
  243. Controller.B2SSetCredits Credit
  244. end if
  245. end if
  246.  
  247. if keycode = 5 then
  248. playsound "coin3"
  249. coindelay.enabled=true
  250. If B2SOn Then
  251. Controller.B2SSetCredits Credit
  252. end if
  253. end if
  254.  
  255. If Keycode = 4 Then
  256. Target4Mover
  257. End If
  258.  
  259. if keycode = 2 and credit>0 and state=false and playno=0 then
  260. credit=credit-1
  261. credittxt.text=credit
  262. eg=0
  263. playno=1
  264. MovingTargetTimer.enabled=true
  265. currpl=1
  266. pno.setvalue(playno)
  267. if playno=1 then pno1.state=lightstateon
  268. pno2.state=lightstateoff
  269. pno3.state=lightstateoff
  270. pno4.state=lightstateoff
  271. play(currpl).state=lightstateon
  272. playsound "click"
  273. playsound "initialize"
  274. rst=0
  275. ballinplay=1
  276. resettimer.enabled=true
  277. If B2SOn Then
  278. Controller.B2SSetTilt 0
  279. Controller.B2SSetGameOver 0
  280. Controller.B2SSetMatch 0
  281. Controller.B2SSetCredits Credit
  282. Controller.B2SSetScore 3,HighScore
  283. Controller.B2SSetCanPlay 1
  284. Controller.B2SSetPlayerUp 1
  285. Controller.B2SSetData 81,1
  286. Controller.B2SSetData 82,0
  287. Controller.B2SSetData 83,0
  288. Controller.B2SSetData 84,0
  289. Controller.B2SSetBallInPlay BallInPlay
  290. Controller.B2SSetScoreRolloverPlayer1 0
  291.  
  292. End If
  293. end if
  294.  
  295. if keycode = 2 and credit>0 and state=true and playno>0 and playno<4 and ballinplay<2 then
  296. credit=credit-1
  297. credittxt.text=credit
  298. playno=playno+1
  299. pno.setvalue(playno)
  300. if playno=2 then pno2.state=lightstateon
  301. if playno=3 then pno3.state=lightstateon
  302. if playno=4 then pno4.state=lightstateon
  303. playsound "click"
  304. If B2SOn Then
  305. Controller.B2SSetCredits Credit
  306. Controller.B2SSetCanPlay playno
  307. end if
  308. end if
  309.  
  310. if state=true and tilt=false then
  311.  
  312. If keycode = LeftFlipperKey Then
  313. LeftFlipper.RotateToEnd
  314. 'PlaySound "FlipperUp"
  315. PlaySound SoundFXDOF("FlipperUp", 101, DOFPulse, DOFFlippers)
  316. PlaySound SoundFX("buzz", DOFFlippers)
  317. 'playsound "buzz"
  318. End If
  319.  
  320. If keycode = RightFlipperKey Then
  321. RightFlipper.RotateToEnd
  322. 'PlaySound "FlipperUp"
  323. PlaySound SoundFXDOF("FlipperUp", 102, DOFPulse, DOFFlippers)
  324. PlaySound SoundFX("buzz", DOFFlippers)
  325. 'playsound "buzz"
  326. End If
  327.  
  328. If keycode = LeftTiltKey Then
  329. Nudge 90, 2
  330. checktilt
  331. End If
  332.  
  333. If keycode = RightTiltKey Then
  334. Nudge 270, 2
  335. checktilt
  336. End If
  337.  
  338. If keycode = CenterTiltKey Then
  339. Nudge 0, 2
  340. checktilt
  341. End If
  342. end if
  343.  
  344. End Sub
  345.  
  346. Sub Table1_KeyUp(ByVal keycode)
  347.  
  348. If keycode = PlungerKey Then
  349. Plunger.Fire
  350. playsound "plunger"
  351. End If
  352.  
  353. If keycode = LeftFlipperKey Then
  354. LeftFlipper.RotateToStart
  355. stopsound "buzz"
  356. if state=true and tilt=false then PlaySound "FlipperDown"
  357. 'if state=true and tilt=false then PlaySound SoundFXDOF("FlipperDown", 101, DOFff, DOFFlippers)
  358. End If
  359.  
  360. If keycode = RightFlipperKey Then
  361. RightFlipper.RotateToStart
  362. stopsound "buzz"
  363. if state=true and tilt=false then PlaySound "FlipperDown"
  364. ' if state=true and tilt=false then PlaySound SoundFXDOF("FlipperDown", 102, DOFff, DOFFlippers)
  365. End If
  366.  
  367. End Sub
  368.  
  369. sub flippertimer_timer()
  370. BottomGate.RotY = Flipper2.CurrentAngle+90
  371. BottomGate1.RotY = Flipper1.CurrentAngle+90
  372. Pstopper.Transz= StopperFlip.CurrentAngle
  373. end sub
  374.  
  375.  
  376. sub coindelay_timer
  377. playsound "click"
  378. credit=credit+1
  379. credittxt.text=credit
  380. coindelay.enabled=false
  381. If B2SOn Then
  382. Controller.B2SSetCredits Credit
  383. end if
  384. end sub
  385.  
  386. sub resettimer_timer
  387. rst=rst+1
  388. reel1.resettozero
  389. reel2.resettozero
  390. reel3.resettozero
  391. reel4.resettozero
  392. If B2SOn Then
  393. Controller.B2SSetScorePlayer1 0
  394. Controller.B2SSetScorePlayer2 0
  395. Controller.B2SSetScorePlayer3 0
  396. Controller.B2SSetScorePlayer4 0
  397. end if
  398. if rst=14 then
  399. playsound "kickerkick"
  400. end if
  401. if rst=18 then
  402. newgame
  403. resettimer.enabled=false
  404. end if
  405. end sub
  406.  
  407.  
  408. Sub Target4Mover
  409. Target4.PositionX=360
  410. Target4.Visible=False
  411. Target4X=Target4.X
  412. Target4X=Target4X+10
  413. Target4.Visible=True
  414. End Sub
  415.  
  416.  
  417. sub addscore(points)
  418. if tilt=false then
  419. bell=0
  420. if points=10 or points=1 then
  421. matchnumb=matchnumb+1
  422. end if
  423. if matchnumb=10 then matchnumb=0
  424. end if
  425. if points = 1 or points = 10 or points = 100 then scn=1
  426. if points = 100 then
  427. reel(currpl).addvalue(100)
  428. bell=100
  429. end if
  430. if points = 10 then
  431. reel(currpl).addvalue(10)
  432. bell=10
  433. end if
  434. if points = 1 then
  435. reel(currpl).addvalue(1)
  436. bell=1
  437. end if
  438. if points = 300 then
  439. reel(currpl).addvalue(300)
  440. scn=3
  441. bell=100
  442. end if
  443. if points = 200 then
  444. reel(currpl).addvalue(200)
  445. scn=2
  446. bell=100
  447. end if
  448. if points = 500 then
  449. reel(currpl).addvalue(500)
  450. scn=5
  451. bell=100
  452. end if
  453. if points = 400 then
  454. reel(currpl).addvalue(400)
  455. scn=4
  456. bell=100
  457. end if
  458. if points = 30 then
  459. reel(currpl).addvalue(30)
  460. scn=3
  461. bell=10
  462. end if
  463. if points = 20 then
  464. reel(currpl).addvalue(20)
  465. scn=2
  466. bell=10
  467. end if
  468. if points = 50 then
  469. reel(currpl).addvalue(50)
  470. scn=5
  471. bell=10
  472. end if
  473. if points = 40 then
  474. reel(currpl).addvalue(40)
  475. scn=4
  476. bell=10
  477. end if
  478. scn1=0
  479. scntimer.enabled=true
  480. score(currpl)=score(currpl)+points
  481. truesc(currpl)=truesc(currpl)+points
  482. If B2SOn Then
  483. Controller.B2SSetScore currpl,score(currpl)
  484. end if
  485. if score(currpl)>9999 then
  486. score(currpl)=score(currpl)-10000
  487. rep(currpl)=0
  488. end if
  489. if score(currpl)=>replay1 and rep(currpl)=0 then
  490. credit=credit+1
  491. 'playsound "knocke"
  492. PlaySound SoundFX("", DOFFlippers)
  493. credittxt.text=credit
  494. If B2SOn Then
  495. Controller.B2SSetCredits Credit
  496. end if
  497. rep(currpl)=1
  498. 'playsound "click"
  499. PlaySound SoundFX("click", DOFFlippers)
  500. end if
  501. if score(currpl)=>replay2 and rep(currpl)=1 then
  502. credit=credit+1
  503. ' playsound "knocke"
  504. PlaySound SoundFX("knocke", DOFFlippers)
  505. credittxt.text=credit
  506. If B2SOn Then
  507. Controller.B2SSetCredits Credit
  508. end if
  509. rep(currpl)=2
  510. ' playsound "click"
  511. PlaySound SoundFX("click", DOFFlippers)
  512. end if
  513. if score(currpl)=>replay3 and rep(currpl)=2 then
  514. credit=credit+1
  515. ' playsound "knocke"
  516. PlaySound SoundFX("knocke", DOFFlippers)
  517. credittxt.text=credit
  518. If B2SOn Then
  519. Controller.B2SSetCredits Credit
  520. end if
  521. rep(currpl)=3
  522. ' playsound "click"
  523. PlaySound SoundFX("click", DOFFlippers)
  524. end if
  525. end sub
  526.  
  527. sub scntimer_timer
  528. scn1=scn1 + 1
  529. 'if bell=1 then playsound "bell1",0, 0.10, 0, 0
  530. if bell=1 then playsound SoundFXDOF("bell1",201,DOFPulse,DOFChimes),0, 0.10, 0, 0
  531. 'if bell=10 then playsound "bell10",0, 0.15, 0, 0
  532. if bell=10 then playsound SoundFXDOF("bell1",202,DOFPulse,DOFChimes),0, 0.15, 0, 0
  533. 'if bell=100 then playsound "bell100",0, 0.30, 0, 0
  534. if bell=100 then playsound SoundFXDOF("bell1",203,DOFPulse,DOFChimes),0, 0.30, 0, 0
  535. if scn1=scn then scntimer.enabled=false
  536. end sub
  537.  
  538.  
  539. sub newgame
  540. wv=0
  541. wheelcheck
  542. If Target1.IsDropped=True then Target1.IsDropped=False
  543. If Target2.IsDropped=True then Target2.IsDropped=False
  544. ' DropTarget3.IsDropped = False ' Reset all three drop targets
  545. ' DropTarget4.IsDropped = False
  546. ' DropTarget5.IsDropped = False
  547. ' Playsound "solenoid"
  548. ' PlaySound SoundFXDOF("solenoid", 204, DOFPulse, DOFContactors)
  549. TargetsDown = 0
  550. Light8.State=LightStateOff
  551. Light9.State=LightStateOff
  552. Stopper.IsDropped=True
  553. StopperFlip.rotatetostart
  554. Lstopper.state=0
  555. state=true
  556. wv=0
  557. wheelcheck
  558. rep(1)=0
  559. rep(2)=0
  560. rep(3)=0
  561. eg=0
  562. laf=0
  563. score(1)=0
  564. score(2)=0
  565. score(3)=0
  566. score(4)=0
  567. truesc(1)=0
  568. truesc(2)=0
  569. truesc(3)=0
  570. truesc(4)=0
  571. bumper1.force=5
  572. bumper2.force=5
  573. bumper3.force=5
  574. bumper4.force=1
  575. bumper5.force=1
  576. bip5.text=" "
  577. bip1.text="1"
  578. for i=0 to 9
  579. match(i).text=" "
  580. next
  581. tilttext.text=" "
  582. gamov.text=" "
  583. tilt=false
  584. tiltsens=0
  585. ballinplay=1
  586. nb.CreateBall
  587. PlaySound SoundFXDOF("fx_Ballrel", 110, DOFPulse, DOFContactors)
  588. nb.kick 90,6
  589. If B2SOn then Controller.B2SSetBallInPlay 1
  590. end sub
  591.  
  592.  
  593. Sub Drain_Hit()
  594. playsound "drainshorter"
  595. Drain.DestroyBall
  596. wv=0
  597. wheelcheck
  598. Flipper1.RotateToStart
  599. Flipper2.RotateToStart
  600. nextball
  601. End Sub
  602.  
  603. sub nextball
  604. if tilt=true then
  605. tilt=false
  606. If B2SOn Then Controller.B2SSetTilt 0:Controller.B2SSetShootAgain 0
  607. tilttext.text=" "
  608. Stopper.IsDropped=True
  609. StopperFlip.rotatetostart
  610. Lstopper.state=0
  611. DropTarget3.IsDropped = False ' Reset all three drop targets
  612. DropTarget4.IsDropped = False
  613. DropTarget5.IsDropped = False
  614. TargetsDown = 0
  615. If Target1.IsDropped=True then Target1.IsDropped=False
  616. If Target2.IsDropped=True then Target2.IsDropped=False
  617. ' PlaySound SoundFXDOF("solenoid", 204, DOFPulse, DOFContactors)
  618. Light8.State=LightStateOff
  619. Light9.State=LightStateOff
  620. Bumper1.force=5
  621. bumper2.force=5
  622. bumper3.force=5
  623. bumper4.force=1
  624. bumper5.force=1
  625. tiltseq.stopplay
  626. pno.setvalue(playno)
  627. LeftSlingShot.isdropped=false
  628. RightSlingShot.isdropped=false
  629. end if
  630. newball
  631. ' DropTarget3.IsDropped = False ' Reset all three drop targets
  632. ' DropTarget4.IsDropped = False
  633. ' DropTarget5.IsDropped = False
  634. TargetsDown = 0
  635. ballreltimer.enabled=true
  636. currpl=currpl+1
  637. If B2SOn Then
  638. Controller.B2SSetData 81,0
  639. Controller.B2SSetData 82,0
  640. Controller.B2SSetData 83,0
  641. Controller.B2SSetData 84,0
  642. Controller.B2SSetData (80+currpl),1
  643. end If
  644. if currpl>playno then
  645. ballinplay=ballinplay+1
  646. if ballinplay>5 then
  647. playsound "motorleer"
  648. If B2SOn then Controller.B2SSetBallInPlay 0
  649. eg=1
  650. ballreltimer.enabled=true
  651. else
  652. if state=true and tilt=false then
  653. play(currpl-1).state=lightstateoff
  654. currpl=1
  655. play(currpl).state=lightstateon
  656. If B2SOn Then
  657. Controller.B2SSetData 81,0
  658. Controller.B2SSetData 82,0
  659. Controller.B2SSetData 83,0
  660. Controller.B2SSetData 84,0
  661. Controller.B2SSetData (80+currpl),1
  662. end If
  663. newball
  664. playsound "kickerkick"
  665. ballreltimer.enabled=true
  666. end if
  667. If B2SOn then Controller.B2SSetBallInPlay ballinplay
  668. select case (ballinplay)
  669. case 1:
  670. bip1.text="1"
  671. case 2:
  672. bip1.text=" "
  673. bip2.text="2"
  674. case 3:
  675. bip2.text=" "
  676. bip3.text="3"
  677. case 4:
  678. bip3.text=" "
  679. bip4.text="4"
  680. case 5:
  681. bip4.text=" "
  682. bip5.text="5"
  683. end select
  684. end if
  685. end if
  686. if currpl>1 and currpl<(playno+1) then
  687. if state=true and tilt=false then
  688. play(currpl-1).state=lightstateoff
  689. play(currpl).state=lightstateon
  690. If B2SOn Then
  691. Controller.B2SSetData 81,0
  692. Controller.B2SSetData 82,0
  693. Controller.B2SSetData 83,0
  694. Controller.B2SSetData 84,0
  695. Controller.B2SSetData (80+currpl),1
  696. end If
  697. newball
  698. playsound "kickerkick"
  699. ballreltimer.enabled=true
  700. end if
  701. end if
  702. end Sub
  703.  
  704. sub ballreltimer_timer
  705. if eg=1 then
  706. matchnum
  707. bip3.text=" "
  708. bip5.text=" "
  709. 'bipreel.setvalue(0)
  710. state=false
  711. for i=1 to 4
  712. if truesc(i)>hisc then
  713. hisc=truesc(i)
  714. reel5.setvalue(hisc)
  715. end if
  716. next
  717. pno.setvalue(0)
  718. play(currpl-1).state=lightstateoff
  719. playno=0
  720. gamov.text="GAME OVER"
  721. If B2SOn Then
  722. Controller.B2SSetGameOver 1
  723. end if
  724. MovingTargetTimer.enabled=false
  725. savehs
  726. ballreltimer.enabled=false
  727. else
  728. nb.CreateBall
  729. PlaySound SoundFXDOF("fx_Ballrel", 110, DOFPulse, DOFContactors)
  730. nb.kick 90,6
  731. Stopper.IsDropped=True
  732. StopperFlip.rotatetostart
  733. Lstopper.state=0
  734. ballreltimer.enabled=false
  735. end if
  736. end sub
  737.  
  738. sub newball
  739. If Target1.IsDropped=True then Target1.IsDropped=False
  740. If Target2.IsDropped=True then Target2.IsDropped=False
  741. ' PlaySound SoundFXDOF("solenoid", 204, DOFPulse, DOFContactors)
  742. Light8.State=LightStateOff
  743. Light9.State=LightStateOff
  744. loutl.state=lightstateoff
  745. routl.state=lightstateoff
  746. hv=0
  747. Light1.State=LightStateOn
  748. Light2.State=LightStateOff
  749. Light3.State=LightStateOff
  750. Light4.State=LightStateOff
  751. Light5.State=LightStateOff
  752. Light6.State=LightStateOff
  753. Light7.State=LightStateOff
  754. end sub
  755.  
  756. sub matchnum
  757. select case(matchnumb)
  758. case 0:
  759. m0.text="0"
  760. case 1:
  761. m1.text="1"
  762. case 2:
  763. m2.text="2"
  764. case 3:
  765. m3.text="3"
  766. case 4:
  767. m4.text="4"
  768. case 5:
  769. m5.text="5"
  770. case 6:
  771. m6.text="6"
  772. case 7:
  773. m7.text="7"
  774. case 8:
  775. m8.text="8"
  776. case 9:
  777. m9.text="9"
  778. end select
  779. If B2SOn Then
  780.  
  781. if matchnumb=0 then
  782. Controller.B2SSetMatch 10
  783. else
  784. Controller.B2SSetMatch matchnumb
  785. end if
  786. end if
  787. for i=1 to playno
  788. if (matchnumb*10)=(score(i) mod 10) then
  789. credit=credit+1
  790. If B2SOn Then
  791. Controller.B2SSetCredits Credit
  792. end if
  793. playsound "knocke"
  794. credittxt.text= credit
  795. playsound "click"
  796. end if
  797. next
  798. end sub
  799.  
  800. Sub CheckTilt
  801. If Tilttimer.Enabled = True Then
  802. TiltSens = TiltSens + 1
  803. if TiltSens = 2 Then
  804. Tilt = True
  805. tilttext.text="TILT"
  806. If B2SOn Then Controller.B2SSetTilt 1
  807. tiltsens = 0
  808. playsound "tilt"
  809. turnoff
  810. End If
  811. Else
  812. TiltSens = 0
  813. Tilttimer.Enabled = True
  814. End If
  815. End Sub
  816.  
  817. Sub Tilttimer_Timer()
  818. Tilttimer.Enabled = False
  819. End Sub
  820.  
  821. sub turnoff
  822. bumper1.force=0
  823. bumper2.force=0
  824. bumper3.force=0
  825. bumper4.force=0
  826. bumper5.force=0
  827. tiltseq.play seqalloff
  828. pno.setvalue(5)
  829. LeftSlingShot.isdropped=true
  830. RightSlingShot.isdropped=true
  831. end sub
  832.  
  833.  
  834. Sub lsling2_Slingshot()
  835. if tilt=false then addscore 1
  836. End Sub
  837.  
  838. Sub rsling2_Slingshot()
  839. if tilt=flase then addscore 1
  840. End Sub
  841.  
  842. Sub lsling3_Slingshot()
  843. if tilt=false then addscore 1
  844. End Sub
  845.  
  846. Sub rsling3_Slingshot()
  847. if tilt=flase then addscore 1
  848. End Sub
  849.  
  850. Sub lsling4_Slingshot()
  851. if tilt=false then addscore 1
  852. End Sub
  853.  
  854. Sub rsling4_Slingshot()
  855. if tilt=flase then addscore 1
  856. End Sub
  857.  
  858. Sub lsling5_Slingshot()
  859. if tilt=false then addscore 1
  860. End Sub
  861.  
  862. Sub rsling5_Slingshot()
  863. if tilt=flase then addscore 1
  864. End Sub
  865.  
  866. sub bumper1_hit
  867. ' if tilt=false then playsound "jet1"
  868. if tilt=false then playsound SoundFXDOF("jet1",107,DOFPulse,DOFContactors)
  869. addscore 10
  870. me.timerenabled=1
  871. end sub
  872.  
  873. Sub Bumper1_timer
  874. BumperTimerRing1.Enabled=0
  875. if bumperring1.transz>-36 then BumperRing1.transz=BumperRing1.transz-4
  876. if BumperRing1.transz=-36 then
  877. BumperTimerRing1.enabled=1
  878. me.timerenabled=0
  879. end if
  880. End Sub
  881.  
  882. Sub BumperTimerRing1_timer
  883. if bumperring1.transz<0 then BumperRing1.transz=BumperRing1.transz+4
  884. If BumperRing1.transz=0 then BumperTimerRing1.enabled=0
  885. End sub
  886.  
  887. sub bumper2_hit
  888. 'if tilt=false then playsound "jet1"
  889. if tilt=false then playsound SoundFXDOF("jet1",108,DOFPulse,DOFContactors)
  890. addscore 10
  891. me.timerenabled=1
  892. end sub
  893.  
  894. Sub Bumper2_timer
  895. BumperTimerRing2.enabled=0
  896. if BumperRing2.transz>-36 then BumperRing2.transz=BumperRing2.transz-4
  897. if BumperRing2.transz=-36 then
  898. BumperTimerRing2.enabled=1
  899. me.timerenabled=0
  900. end if
  901. End Sub
  902.  
  903. Sub BumperTimerRing2_timer
  904. if BumperRing2.transz<0 then BumperRing2.transz=BumperRing2.transz+4
  905. If BumperRing2.transz=0 then BumperTimerRing2.enabled=0
  906. End sub
  907.  
  908. sub bumper3_hit
  909. 'if tilt=false then playsound "jet1"
  910. if tilt=false then playsound SoundFXDOF("jet1",109,DOFPulse,DOFContactors)
  911. addscore 10
  912. me.timerenabled=1
  913. end sub
  914.  
  915. Sub Bumper3_timer
  916. BumperTimerRing3.enabled=0
  917. if bumperring3.transz>-36 then BumperRing3.transz=BumperRing3.transz-4
  918. if BumperRing3.transz=-36 then
  919. BumperTimerRing3.enabled=1
  920. me.timerenabled=0
  921. end if
  922. End Sub
  923.  
  924. Sub BumperTimerRing3_timer
  925. if bumperring3.transz<0 then BumperRing3.transz=BumperRing3.transz+4
  926. If BumperRing3.transz=0 then BumperTimerRing3.enabled=0
  927. End sub
  928.  
  929. sub bumper4_hit
  930. ' if tilt=false then playsound "buzz"
  931. if tilt=false then playsound SoundFXDOF("buzz",112,DOFPulse,DOFContactors)
  932. addscore 10
  933. wv=wv+1
  934. wheelcheck
  935. end sub
  936.  
  937. sub bumper5_hit
  938. ' if tilt=false then playsound "buzz"
  939. if tilt=false then playsound SoundFXDOF("buzz",113,DOFPulse,DOFContactors)
  940. addscore 10
  941. wv=wv+1
  942. wheelcheck
  943. end sub
  944.  
  945. Sub Trigger1_Hit()
  946. Addscore 100
  947. HoleValue
  948. End Sub
  949.  
  950. sub Kicker1_Hit()
  951. if tilt=false then
  952. holecheck
  953. playsound "motorshort1s"
  954. end if
  955. kickstep=1
  956. me.timerenabled=1
  957. end sub
  958.  
  959. sub Kicker1_timer
  960. Select Case kickstep
  961. Case 4:
  962. 'playsound "kickerkick"
  963. playsound SoundFXDOF("kickerkick",120,DOFPulse,DOFContactors)
  964. Pkickarm.rotz=10
  965. kicker1.kick 240,10
  966. Case 5:
  967. Pkickarm.rotz=0
  968. me.timerenabled=0
  969. End Select
  970. kickstep=kickstep+1
  971. end Sub
  972.  
  973. Sub Kicker2_Hit()
  974. playsound "motorshort1s"
  975. me.timerenabled=1
  976. loutl.State=LightStateOff
  977. Flipper1Timer.enabled=True
  978. End Sub
  979.  
  980. sub kicker2_timer
  981. playsound "kickerkick"
  982. playsound SoundFXDOF("kickerkick",118,DOFPulse,DOFContactors)
  983. Kicker2.kick 0, 20
  984. me.timerenabled=0
  985. end sub
  986.  
  987. Sub Flipper1Timer_Timer
  988. Flipper1.RotateToStart
  989. Flipper1Timer.enabled=False
  990. End Sub
  991.  
  992. Sub Flipper2Timer_Timer
  993. Flipper2.RotateToStart
  994. Flipper2Timer.enabled=False
  995. End Sub
  996.  
  997.  
  998. sub wheelcheck
  999. If wv=>5 then wv=0
  1000. If wv=0 then
  1001. Light10.State=LightStateOn
  1002. Light11.State=LightStateOff
  1003. Light12.State=LightStateOff
  1004. Light13.State=LightStateOn
  1005. Light14.State=LightStateOff
  1006. Light15.State=LightStateOff
  1007. Light16.State=LightStateOff
  1008. Light17.State=LightStateOff
  1009. Light18.State=LightStateOff
  1010. Light19.State=LightStateOff
  1011. End If
  1012. If wv=1 then
  1013. Light10.State=LightStateOff
  1014. Light11.State=LightStateOff
  1015. Light12.State=LightStateOff
  1016. Light13.State=LightStateOff
  1017. Light14.State=LightStateOff
  1018. Light15.State=LightStateOff
  1019. Light16.State=LightStateOn
  1020. Light17.State=LightStateOn
  1021. Light18.State=LightStateOff
  1022. Light19.State=LightStateOff
  1023. End If
  1024. If wv=2 then
  1025. Light10.State=LightStateOff
  1026. Light11.State=LightStateOn
  1027. Light12.State=LightStateOff
  1028. Light13.State=LightStateOff
  1029. Light14.State=LightStateOn
  1030. Light15.State=LightStateOff
  1031. Light16.State=LightStateOff
  1032. Light17.State=LightStateOff
  1033. Light18.State=LightStateOff
  1034. Light19.State=LightStateOff
  1035. End If
  1036. If wv=3 then
  1037. Light10.State=LightStateOff
  1038. Light11.State=LightStateOff
  1039. Light12.State=LightStateOff
  1040. Light13.State=LightStateOff
  1041. Light14.State=LightStateOff
  1042. Light15.State=LightStateOff
  1043. Light16.State=LightStateOff
  1044. Light17.State=LightStateOff
  1045. Light18.State=LightStateOn
  1046. Light19.State=LightStateOn
  1047. End If
  1048. If wv=4 then
  1049. Light10.State=LightStateOff
  1050. Light11.State=LightStateOff
  1051. Light12.State=LightStateOn
  1052. Light13.State=LightStateOff
  1053. Light14.State=LightStateOff
  1054. Light15.State=LightStateOn
  1055. Light16.State=LightStateOff
  1056. Light17.State=LightStateOff
  1057. Light18.State=LightStateOff
  1058. Light19.State=LightStateOff
  1059. End If
  1060.  
  1061. end sub
  1062.  
  1063.  
  1064. Sub HoleValue
  1065. If Light16.State=LightStateOn then loutl.State=LightStateOn: Flipper1.RotateToEnd
  1066. If Light19.State=LightStateOn then routl.State=LightStateOn: Flipper2.RotateToEnd
  1067. If wv=0 or wv=2 or wv=4 then hv=hv+1
  1068. If hv=0 then Light1.State=LightStateOn
  1069. If hv=1 then Light1.state=LightstateOff: Light2.State=LightStateOn
  1070. If hv=2 then Light2.state=LightstateOff: Light3.State=LightStateOn
  1071. If hv=3 then Light3.state=LightstateOff: Light4.State=LightStateOn
  1072. If hv=4 then Light4.state=LightstateOff: Light5.State=LightStateOn
  1073. If hv=5 then Light5.state=LightstateOff: Light6.State=LightStateOn
  1074. If hv=6 then Light6.state=LightstateOn: Light7.State=LightStateOn
  1075. If hv>7 then hv=7
  1076.  
  1077. End Sub
  1078.  
  1079.  
  1080. Sub HoleCheck
  1081. If Light1.State=LightStateOn then Addscore 50
  1082. If Light2.State=LightStateOn then Addscore 100
  1083. If Light3.State=LightStateOn then Addscore 200
  1084. If Light4.State=LightStateOn then Addscore 300
  1085. If Light5.State=LightStateOn then Addscore 400
  1086. If Light6.State=LightStateOn then Addscore 500
  1087. If Light7.State=LightStateOn then Credit=Credit+1: Playsound "Knock": credittxt.text= credit
  1088. End Sub
  1089.  
  1090. '**********Sling Shot Animations
  1091. ' Rstep and Lstep are the variables that increment the animation
  1092. '****************
  1093. Dim RStep, Lstep
  1094.  
  1095. Sub RightSlingShot_Slingshot
  1096. 'PlaySound "right_slingshot", 0, 1, 0.05, 0.05
  1097. PlaySound SoundFXDOF("right_slingshot", 105, DOFPulse, DOFContactors), 0, 1, 0.05, 0.05
  1098. RSling.Visible = 0
  1099. RSling1.Visible = 1
  1100. sling1.TransZ = -20
  1101. RStep = 0
  1102. RightSlingShot.TimerEnabled = 1
  1103. addscore 1
  1104. End Sub
  1105.  
  1106. Sub RightSlingShot_Timer
  1107. Select Case RStep
  1108. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  1109. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
  1110. End Select
  1111. RStep = RStep + 1
  1112. End Sub
  1113.  
  1114. Sub LeftSlingShot_Slingshot
  1115. 'PlaySound "left_slingshot",0,1,-0.05,0.05
  1116. PlaySound SoundFXDOF("left_slingshot", 103, DOFPulse, DOFContactors),0,1,-0.05,0.05
  1117. LSling.Visible = 0
  1118. LSling1.Visible = 1
  1119. sling2.TransZ = -20
  1120. LStep = 0
  1121. LeftSlingShot.TimerEnabled = 1
  1122. addscore 1
  1123. End Sub
  1124.  
  1125. Sub LeftSlingShot_Timer
  1126. Select Case LStep
  1127. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  1128. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
  1129. End Select
  1130. LStep = LStep + 1
  1131. End Sub
  1132.  
  1133.  
  1134. sub savehs
  1135. savevalue "Gay90s", "credit", credit
  1136. savevalue "Gay90s", "hiscore", hisc
  1137. savevalue "Gay90s", "match", matchnumb
  1138. savevalue "Gay90s", "score1", truesc(1)
  1139. savevalue "Gay90s", "score2", truesc(2)
  1140. savevalue "Gay90s", "score2", truesc(3)
  1141. savevalue "Gay90s", "score2", truesc(4)
  1142. end sub
  1143.  
  1144. sub loadhs
  1145. dim temp
  1146. temp = LoadValue("Gay90s", "credit")
  1147. If (temp <> "") then credit = CDbl(temp)
  1148. temp = LoadValue("Gay90s", "hiscore")
  1149. If (temp <> "") then hisc = CDbl(temp)
  1150. temp = LoadValue("Gay90s", "match")
  1151. If (temp <> "") then matchnumb = CDbl(temp)
  1152. temp = LoadValue("Gay90s", "score1")
  1153. If (temp <> "") then score(1) = CDbl(temp)
  1154. temp = LoadValue("Gay90s", "score2")
  1155. If (temp <> "") then score(2) = CDbl(temp)
  1156. temp = LoadValue("Gay90s", "score3")
  1157. If (temp <> "") then score(3) = CDbl(temp)
  1158. temp = LoadValue("Gay90s", "score4")
  1159. If (temp <> "") then score(4) = CDbl(temp)
  1160. end sub
  1161.  
  1162.  
  1163. sub ballrel_hit
  1164. if ballrelenabled=1 then
  1165. playsound "launchball"
  1166. ballrelenabled=0
  1167. end if
  1168. end sub
  1169.  
  1170. Sub Trigger2_Hit()
  1171. Addscore 100
  1172. End Sub
  1173.  
  1174. Sub Trigger3_Hit()
  1175. Addscore 100
  1176. End Sub
  1177.  
  1178. Sub Trigger4_Hit()
  1179. Addscore 100
  1180. routl.State=LightStateOff
  1181. Flipper2Timer.enabled=True
  1182. End Sub
  1183.  
  1184. Sub Target1_dropped()
  1185. Target1.Isdropped=True
  1186. Light8.State=LightStateOn
  1187. Stopper.IsDropped=False
  1188. StopperFlip.rotatetoend
  1189. Lstopper.state=1
  1190. Addscore 10
  1191. TargetTimer.Enabled=True
  1192. End Sub
  1193.  
  1194. Sub Target2_dropped()
  1195. Target2.Isdropped=True
  1196. Light9.State=LightStateOn
  1197. Stopper.IsDropped=False
  1198. StopperFlip.rotatetoend
  1199. Lstopper.state=1
  1200. Addscore 10
  1201. TargetTimer.Enabled=True
  1202. End Sub
  1203.  
  1204. Sub TargetTimer_Timer
  1205. If Target2.IsDropped and Target1.IsDropped then Target2.IsDropped=False: Target1.IsDropped=False: Light8.State=LightStateOff: Light9.State=LightStateOff: Addscore 200: hv=hv+1: PlaySound SoundFXDOF("solenoid", 111, DOFPulse, DOFContactors):end if
  1206. 'Playsound "solenoid":end if
  1207. If hv=0 then Light1.State=LightStateOn
  1208. If hv=1 then Light1.state=LightstateOff: Light2.State=LightStateOn
  1209. If hv=2 then Light2.state=LightstateOff: Light3.State=LightStateOn
  1210. If hv=3 then Light3.state=LightstateOff: Light4.State=LightStateOn
  1211. If hv=4 then Light4.state=LightstateOff: Light5.State=LightStateOn
  1212. If hv=5 then Light5.state=LightstateOff: Light6.State=LightStateOn
  1213. If hv=6 then Light6.state=LightstateOn: Light7.State=LightStateOn
  1214. If hv>7 then hv=7
  1215. TargetTimer.Enabled=False
  1216. End Sub
  1217.  
  1218. Sub TargetTimer1_Timer
  1219. ' DropTarget3.IsDropped = False ' Reset all three drop targets
  1220. ' DropTarget4.IsDropped = False
  1221. ' DropTarget5.IsDropped = False
  1222. Playsound "solenoid"
  1223. TargetTimer1.enabled=False
  1224. End Sub
  1225.  
  1226.  
  1227. '******************************************
  1228. '*** CenterTargets Handler ***
  1229. '******************************************
  1230.  
  1231. Sub Collection2_hit(idx)
  1232. AddScore 100
  1233. HoleValue
  1234. end sub
  1235.  
  1236. Dim TargetsDown ' number of targets hit in the bank. Set this to 0 at start of your game
  1237. Targetsdown=0
  1238.  
  1239.  
  1240. Sub DropTarget3_Hit()
  1241. AddScore 10 ' Add some points
  1242. TargetsDown = TargetsDown + 1 ' Bump the number of targets down by 1
  1243. DropTarget3.IsDropped = True ' This actually drops the target
  1244. CheckDropTargets ' Check to see if we got all of them
  1245. End Sub
  1246.  
  1247. ' Hit Event for Drop Target2
  1248.  
  1249. Sub DropTarget4_Hit()
  1250. AddScore 10 ' Add some points
  1251. TargetsDown = TargetsDown + 1 ' Bump the number of targets down by 1
  1252. DropTarget4.IsDropped = True ' This actually drops the target
  1253. CheckDropTargets ' Check to see if we got all of them
  1254. End Sub
  1255.  
  1256. ' Hit Event for Drop Target3
  1257.  
  1258. Sub DropTarget5_Hit()
  1259. AddScore 10 ' Add some points
  1260. TargetsDown = TargetsDown + 1 ' Bump the number of targets down by 1
  1261. DropTarget5.IsDropped = True ' This actually drops the target
  1262. CheckDropTargets ' Check to see if we got all of them
  1263. End Sub
  1264.  
  1265. Sub CheckDropTargets()
  1266. If TargetsDown => 3 then
  1267. Holevalue ' Add some points for clearing the bank if desired
  1268. Addscore 300
  1269. TargetTimer1.enabled=True
  1270. TargetsDown = 0 ' Reset the counter to 0
  1271. End If
  1272. End Sub
  1273.  
  1274. Sub LeftSlingShot1_Slingshot()
  1275. Addscore 1
  1276. stopper.IsDropped=True
  1277. StopperFlip.rotatetostart
  1278. Lstopper.state=0
  1279. wv=wv+1
  1280. wheelcheck
  1281. rdwa.visible=0
  1282. RdwA1.visible=1
  1283. rdwastep=1
  1284. me.timerenabled=1
  1285. End Sub
  1286.  
  1287. Sub Leftslingshot1_timer
  1288. select case rdwastep
  1289. Case 1: RDWa1.visible=0: rdwa.visible=1
  1290. case 2: rdwa.visible=0: rdwa2.visible=1
  1291. Case 3: rdwa2.visible=0: rdwa.visible=1: Me.timerenabled=0
  1292. end Select
  1293. rdwastep=rdwastep+1
  1294. End sub
  1295.  
  1296. Sub LeftSlingShot2_Slingshot()
  1297. Addscore 1
  1298. rdwb.visible=0
  1299. Rdwb1.visible=1
  1300. rdwbstep=1
  1301. me.timerenabled=1
  1302. End Sub
  1303.  
  1304. Sub Leftslingshot2_timer
  1305. select case rdwbstep
  1306. Case 1: RDWb1.visible=0: rdwb.visible=1
  1307. case 2: rdwb.visible=0: rdwb2.visible=1
  1308. Case 3: rdwb2.visible=0: rdwb.visible=1: Me.timerenabled=0
  1309. end Select
  1310. rdwbstep=rdwbstep+1
  1311. End sub
  1312.  
  1313. Sub LeftSlingShot3_Slingshot()
  1314. Addscore 1
  1315. End Sub
  1316.  
  1317. Sub LeftSlingShot4_Slingshot()
  1318. Addscore 1
  1319. End Sub
  1320.  
  1321. Sub LeftSlingShot5_Slingshot()
  1322. Addscore 1
  1323. End Sub
  1324.  
  1325. Sub RightSlingShot1_Slingshot()
  1326. Addscore 1
  1327. stopper.IsDropped=True
  1328. StopperFlip.rotatetostart
  1329. Lstopper.state=0
  1330. wv=wv+1
  1331. wheelcheck
  1332. rdwc.visible=0
  1333. Rdwc1.visible=1
  1334. rdwcstep=1
  1335. me.timerenabled=1
  1336. End Sub
  1337.  
  1338. Sub Rightslingshot1_timer
  1339. select case rdwcstep
  1340. Case 1: RDWc1.visible=0: rdwc.visible=1
  1341. case 2: rdwc.visible=0: rdwc2.visible=1
  1342. Case 3: rdwc2.visible=0: rdwc.visible=1: Me.timerenabled=0
  1343. end Select
  1344. rdwcstep=rdwcstep+1
  1345. End sub
  1346.  
  1347. Sub RightSlingShot2_Slingshot()
  1348. Addscore 1
  1349. rdwd.visible=0
  1350. Rdwd1.visible=1
  1351. rdwdstep=1
  1352. me.timerenabled=1
  1353. End Sub
  1354.  
  1355. Sub Rightslingshot2_timer
  1356. select case rdwdstep
  1357. Case 1: RDWd1.visible=0: rdwd.visible=1
  1358. case 2: rdwd.visible=0: rdwd2.visible=1
  1359. Case 3: rdwd2.visible=0: rdwd.visible=1: Me.timerenabled=0
  1360. end Select
  1361. rdwdstep=rdwdstep+1
  1362. End sub
  1363.  
  1364. Sub RightSlingShot3_Slingshot()
  1365. Addscore 1
  1366. End Sub
  1367.  
  1368. Sub RightSlingShot4_Slingshot()
  1369. Addscore 1
  1370. End Sub
  1371.  
  1372. Sub RightSlingShot5_Slingshot()
  1373. Addscore 1
  1374. End Sub
  1375.  
  1376. Sub RightSlingShot6_Slingshot()
  1377. Addscore 1
  1378. rdwe.visible=0
  1379. Rdwe1.visible=1
  1380. rdwestep=1
  1381. me.timerenabled=1
  1382. End Sub
  1383.  
  1384. Sub Rightslingshot6_timer
  1385. select case rdwestep
  1386. Case 1: RDWe1.visible=0: rdwe.visible=1
  1387. case 2: rdwe.visible=0: rdwe2.visible=1
  1388. Case 3: rdwe2.visible=0: rdwe.visible=1: Me.timerenabled=0
  1389. end Select
  1390. rdwestep=rdwestep+1
  1391. End sub
  1392.  
  1393. ' *********************************************************************
  1394. ' Supporting Ball & Sound Functions
  1395. ' *********************************************************************
  1396.  
  1397. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1398. Vol = Csng(BallVel(ball) ^2 / 2000)
  1399. End Function
  1400.  
  1401. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "Table1" is the name of the table
  1402. Dim tmp
  1403. tmp = ball.x * 2 / Table1.width-1
  1404. If tmp > 0 Then
  1405. Pan = Csng(tmp ^10)
  1406. Else
  1407. Pan = Csng(-((- tmp) ^10) )
  1408. End If
  1409. End Function
  1410.  
  1411. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1412. Pitch = BallVel(ball) * 20
  1413. End Function
  1414.  
  1415. Function BallVel(ball) 'Calculates the ball speed
  1416. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1417. End Function
  1418.  
  1419. '*****************************************
  1420. ' JP's VP10 Rolling Sounds
  1421. '*****************************************
  1422.  
  1423. Const tnob = 5 ' total number of balls
  1424. ReDim rolling(tnob)
  1425. InitRolling
  1426.  
  1427. Sub InitRolling
  1428. Dim i
  1429. For i = 0 to tnob
  1430. rolling(i) = False
  1431. Next
  1432. End Sub
  1433.  
  1434. Sub RollingTimer_Timer()
  1435. Dim BOT, b
  1436. BOT = GetBalls
  1437.  
  1438. ' stop the sound of deleted balls
  1439. For b = UBound(BOT) + 1 to tnob
  1440. rolling(b) = False
  1441. StopSound("fx_ballrolling" & b)
  1442. Next
  1443.  
  1444. ' exit the sub if no balls on the table
  1445. If UBound(BOT) = -1 Then Exit Sub
  1446.  
  1447. ' play the rolling sound for each ball
  1448. For b = 0 to UBound(BOT)
  1449. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1450. rolling(b) = True
  1451. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b))*4, Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1452. Else
  1453. If rolling(b) = True Then
  1454. StopSound("fx_ballrolling" & b)
  1455. rolling(b) = False
  1456. End If
  1457. End If
  1458. Next
  1459. End Sub
  1460.  
  1461. '**********************
  1462. ' Ball Collision Sound
  1463. '**********************
  1464.  
  1465. Sub OnBallBallCollision(ball1, ball2, velocity)
  1466. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1467. End Sub
  1468.  
  1469.  
  1470.  
  1471. '************************************
  1472. ' What you need to add to your table
  1473. '************************************
  1474.  
  1475. ' a timer called RollingTimer. With a fast interval, like 10
  1476. ' one collision sound, in this script is called fx_collide
  1477. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  1478. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  1479.  
  1480.  
  1481. '******************************************
  1482. ' Explanation of the rolling sound routine
  1483. '******************************************
  1484.  
  1485. ' sounds are played based on the ball speed and position
  1486.  
  1487. ' the routine checks first for deleted balls and stops the rolling sound.
  1488.  
  1489. ' The For loop goes through all the balls on the table and checks for the ball speed and
  1490. ' if the ball is on the table (height lower than 30) then then it plays the sound
  1491. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  1492.  
  1493. ' The sound is played using the VOL, PAN and PITCH functions, so the volume and pitch of the sound
  1494. ' will change according to the ball speed, and the PAN function will change the stereo position according
  1495. ' to the position of the ball on the table.
  1496.  
  1497.  
  1498. '**************************************
  1499. ' Explanation of the collision routine
  1500. '**************************************
  1501.  
  1502. ' The collision is built in VP.
  1503. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  1504. ' 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
  1505. ' depending of the speed of the collision.
  1506.  
  1507. Sub a_Pins_Hit (idx)
  1508. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1509. End Sub
  1510.  
  1511. Sub a_Targets_Hit (idx)
  1512. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1513. End Sub
  1514.  
  1515. Sub a_Metals_Thin_Hit (idx)
  1516. PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1517. End Sub
  1518.  
  1519. Sub a_Metals_Medium_Hit (idx)
  1520. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1521. End Sub
  1522.  
  1523. Sub a_Metals2_Hit (idx)
  1524. PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1525. End Sub
  1526.  
  1527. Sub a_Gates_Hit (idx)
  1528. PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1529. End Sub
  1530.  
  1531. Sub a_Spinner_Spin
  1532. PlaySound "fx_spinner",0,.25,0,0.25
  1533. End Sub
  1534.  
  1535. Sub a_Rubbers_Hit(idx)
  1536. dim finalspeed
  1537. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1538. If finalspeed > 20 then
  1539. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1540. End if
  1541. If finalspeed >= 6 AND finalspeed <= 20 then
  1542. RandomSoundRubber()
  1543. End If
  1544. End Sub
  1545.  
  1546. Sub RubberWheel_hit
  1547. dim finalspeed
  1548. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1549. If finalspeed > 20 then
  1550. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1551. End if
  1552. If finalspeed >= 6 AND finalspeed <= 20 then
  1553. RandomSoundRubber()
  1554. End If
  1555. End sub
  1556.  
  1557. Sub a_Posts_Hit(idx)
  1558. dim finalspeed
  1559. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1560. If finalspeed > 16 then
  1561. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1562. End if
  1563. If finalspeed >= 6 AND finalspeed <= 16 then
  1564. RandomSoundRubber()
  1565. End If
  1566. End Sub
  1567.  
  1568. Sub RandomSoundRubber()
  1569. Select Case Int(Rnd*3)+1
  1570. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1571. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1572. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1573. End Select
  1574. End Sub
  1575.  
  1576. Sub LeftFlipper_Collide(parm)
  1577. RandomSoundFlipper()
  1578. End Sub
  1579.  
  1580. Sub RightFlipper_Collide(parm)
  1581. RandomSoundFlipper()
  1582. End Sub
  1583.  
  1584. Sub RandomSoundFlipper()
  1585. Select Case Int(Rnd*3)+1
  1586. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1587. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1588. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1589. End Select
  1590. End Sub
  1591.  
  1592. Sub Table1_Exit()
  1593. Savehs
  1594. If B2SOn Then Controller.stop
  1595. End Sub
Advertisement
Add Comment
Please, Sign In to add comment