Outhere

World's Fair Jigsaw -2 Screen

Sep 22nd, 2021 (edited)
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.08 KB | None | 0 0
  1. Option Explicit
  2. ' World's Fair Pinball
  3. ' Rock-Ola, 1933
  4.  
  5. ' Lock values:
  6. ' 0 = not locked
  7. ' 1 = locked
  8. ' 2 = cannot lock
  9.  
  10. 'Dim Controller,Tilt,Ball,Balls,Credits,ShootBall,Obj,Bonus,XAdv,Bonuscounter,MultiplierCounter,Tens,Ones,Score,Scoretoadd,TimesDroppedA,TimesDroppedB
  11. '*DOF method for non rom controller tables by Arngrim****************
  12. '*******Use DOF 1**, 1 to activate a ledwiz output*******************
  13. '*******Use DOF 1**, 0 to deactivate a ledwiz output*****************
  14. '*******Use DOF 1**, 2 to pulse a ledwiz output**********************
  15. ' World's Fair Jigsaw (1933 Rock-Ola)WIP-2 Screen
  16. 'DOF Config by Outhere
  17. '101
  18. '102
  19. '103
  20. '104
  21. '105
  22. '106
  23. '107
  24. '108
  25. '109
  26. '110 Put Ball into shooter Line
  27. '111
  28. '112 Shaker
  29. '113
  30. '114 Beacon 2000 Points
  31. '115 Beacon 1500 Points
  32. '116 Beacon 1000 Points
  33. '117 Topper Bell
  34. '118 Chime Unit High Tone
  35. '119 Chime Unit Mid Tone
  36. '120 Chime Unit Low Tone
  37. '121
  38. '122
  39. '123
  40. '124
  41. '125
  42. '126
  43. '127
  44. '128
  45. '129
  46. '130
  47.  
  48.  
  49. Sub DOF(dofevent, dofstate)
  50. If B2SOn=True Then
  51. If dofstate = 2 Then
  52. Controller.B2SSetData dofevent, 1:Controller.B2SSetData dofevent, 0
  53. Else Controller.B2SSetData dofevent, dofstate
  54. End If
  55. End If
  56. End Sub
  57. '********************************************************************
  58. 'Sub Table1_Init()
  59.  
  60. Const BallSize = 50
  61.  
  62. On Error Resume Next
  63. ExecuteGlobal GetTextFile("controller.vbs")
  64. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  65. On Error Goto 0
  66.  
  67.  
  68. Const cGameName = "worlds_fair"
  69. 'Const cGameName = "PinballY"
  70.  
  71. ' B2SOn=true
  72. '
  73. 'if B2SOn then
  74. ' Set Controller = CreateObject("B2S.Server")
  75. ' Controller.B2SName = "Jigsaw"
  76. ' Controller.Run()
  77. ' If Err Then MsgBox "Can't Load B2S.Server."
  78. ' Controller.B2SSetScoreRolloverPlayer1 0
  79. 'end if
  80.  
  81.  
  82.  
  83. LoadVPM "01560000", "Bally.VBS", 3.26
  84. Sub LoadVPM(VPMver, VBSfile, VBSver)
  85. End Sub
  86.  
  87.  
  88.  
  89. Dim VarHidden, UseVPMDMD
  90. If Table1.ShowDT = true then
  91. 'UseVPMDMD = True
  92. 'VarHidden = 0
  93. 'lockdown.visible = true
  94. ScoreReel.visible = true
  95. BallReel.visible = true
  96. TextBox1.visible = true
  97.  
  98. else
  99. ScoreReel.visible = false
  100. BallReel.visible = false
  101. TextBox1.visible = false
  102. end if
  103.  
  104. Dim Controller
  105. Dim Ball
  106. Dim B2SOn
  107. Dim Tilted
  108. Dim Tilts
  109. Dim Col1Lock
  110. Dim Col2Lock
  111. Dim Col3Lock
  112. Dim Col4Lock
  113. Dim Col5Lock
  114. dim bump1:bump1 = 0
  115. dim bump2:bump2 = 0
  116. dim bump3:bump3 = 0
  117. dim bump4:bump4 = 0
  118. dim bump5:bump5 = 0
  119. dim bump6:bump6 = 0
  120. dim bump7:bump7 = 0
  121. dim intScore
  122. dim intGameReset
  123. dim intBallsLeft
  124. dim boolDoubleScore
  125. dim PlayerScore
  126.  
  127.  
  128. Sub Table1_KeyDown(ByVal keycode)
  129.  
  130. If PostItHighScoreCheck(keycode) then Exit Sub
  131.  
  132. if keycode=StartGameKey then
  133. if intBallsLeft<1 then
  134.  
  135.  
  136. GameReset
  137. end if
  138. end if
  139.  
  140. If keycode = PlungerKey Then
  141. Plunger.PullBack
  142. PlaySound "plungerpull",0,1,0.25,0.25
  143. End If
  144.  
  145. if Keycode=157 or Keycode=3 or Keycode=205 then
  146. if intBallsLeft > 0 and intGameReset=False then
  147. EjectBall
  148. intBallsLeft=intBallsLeft-1
  149. BallReel.SetValue intBallsLeft
  150. if b2son then Controller.B2SSetCredits intBallsLeft
  151. end if
  152. end if
  153.  
  154.  
  155. If keycode = LeftTiltKey Then
  156. Nudge 90, 3
  157. playsound "nudge"
  158. TiltCheck
  159. End If
  160.  
  161. If keycode = RightTiltKey Then
  162. Nudge 270, 3
  163. playsound "nudge"
  164. TiltCheck
  165. End If
  166.  
  167. If keycode = CenterTiltKey Then
  168. Nudge 0, 3
  169. playsound "nudge"
  170. TiltCheck
  171. End If
  172.  
  173. End Sub
  174.  
  175. Sub Table1_init
  176.  
  177. LoadEM
  178.  
  179. End Sub
  180.  
  181. Sub Table1_KeyUp(ByVal keycode)
  182.  
  183. If keycode = PlungerKey Then
  184. Plunger.Fire
  185. End If
  186.  
  187.  
  188. End Sub
  189.  
  190.  
  191.  
  192. ' Tilt Routine
  193. Sub TiltCheck
  194. If Tilted = FALSE then
  195. If Tilts = 0 then
  196. Tilts = Tilts + int(rnd*100)
  197. TiltTimer.Enabled = TRUE
  198. Else
  199. Tilts = Tilts + int(rnd*120)
  200. End If
  201. If Tilts >= 250 and Tilted = FALSE then
  202. 'GameOn = FALSE
  203. Primitive62.Rotx = Primitive62.Rotx + 180
  204. playsound "tilt"
  205.  
  206. Tilted = TRUE
  207. 'TiltBox.Text = "TILT"
  208.  
  209.  
  210. intGameReset=True
  211.  
  212. 'intGameReset=True
  213. End If
  214. End If
  215. End Sub
  216.  
  217. Sub GameReset
  218. BallGate.IsDropped=True
  219. Divider1.IsDropped=True
  220. Divider2.IsDropped=True
  221. Divider3.IsDropped=True
  222. Divider4.IsDropped=True
  223. DoubleScore.Enabled=False
  224. DoubleScore.Kick 180,1,-1
  225. ScoreReel.ResetToZero
  226. PlayerScore=0
  227. intScore=0
  228. boolDoubleScore=False
  229. RaisePuzzle
  230. intGameReset=True
  231. dim xx
  232. for each xx in puzzleflippers
  233. xx.rotatetoend
  234. Next
  235. GameReset2.enabled = true
  236. startB2S(3) ' This Line Added By Outhere
  237. End Sub
  238.  
  239. Sub GameReset2_Timer
  240. 'GameReset3
  241. GameReset2.Enabled = False
  242. Dim xx
  243. for each xx in puzzleflippers
  244. xx.rotatetoStart
  245. Next
  246. end sub
  247.  
  248. Sub AddScore(HitValue)
  249. PlayerScore=PlayerScore+HitValue
  250. ScoreReel.AddValue(HitValue)
  251. if boolDoubleScore=True then ScoreReel.AddValue(HitValue):PlayerScore=PlayerScore+HitValue
  252. if b2son then Controller.B2SSetScorePlayer1 PlayerScore
  253.  
  254. End sub
  255.  
  256. Sub Drain_Hit()
  257. Drain1.DestroyBall
  258. Drain2.DestroyBall
  259. Drain3.DestroyBall
  260. BallTrap.DestroyBall
  261. BallTrap2.DestroyBall
  262. FreePlay.CreateBall
  263. FreePlay.Kick 90,1
  264. End Sub
  265.  
  266. '=================================== ' These Lines Added By Outhere ========================================
  267. Sub startB2S(aB2S)
  268. If B2SOn Then
  269. Controller.B2SSetData 1,0 ' 2x On
  270. Controller.B2SSetData 2,0 ' 2000
  271. Controller.B2SSetData 3,0 ' Stop Animation
  272. Controller.B2SSetData 4,0 ' 2x Off
  273. Controller.B2SSetData 5,0 ' 700
  274. Controller.B2SSetData 6,0 ' 900
  275. Controller.B2SSetData 7,0 ' 300
  276. Controller.B2SSetData 8,0 ' 200
  277. Controller.B2SSetData 9,0 ' 100
  278. Controller.B2SSetData 10,0 ' 1900
  279. Controller.B2SSetData 11,0 ' 500
  280. Controller.B2SSetData 12,0 ' 600
  281. Controller.B2SSetData 13,0 ' 400
  282. Controller.B2SSetData 14,0 ' 1200
  283. Controller.B2SSetData 15,0 ' 1400
  284. Controller.B2SSetData 16,0 ' 1700
  285. Controller.B2SSetData 17,0 ' --------
  286. Controller.B2SSetData 18,0 ' 1000
  287. Controller.B2SSetData 19,0 ' 1500
  288. Controller.B2SSetData aB2S,1
  289. End If
  290. End Sub
  291.  
  292. '==============================================================================================================
  293.  
  294. Sub timergate_Timer
  295. primitive112.rotz=gate1.CurrentAngle
  296. primitive113.rotz=gate2.CurrentAngle
  297. End Sub
  298.  
  299.  
  300. Sub LeftSlingshot_Slingshot()
  301. PlaySound "Bumper"
  302. End Sub
  303.  
  304. Sub RightSlingshot_Slingshot()
  305. PlaySound "Bumper"
  306. End Sub
  307.  
  308. Sub Drain2_Hit()
  309. Drain_Hit
  310. Playsound "ball_bounce"
  311. End Sub
  312.  
  313. Sub Drain1_Hit()
  314. Playsound "ball_bounce"
  315. Drain_Hit
  316. End Sub
  317.  
  318. Sub BallTrap_Hit()
  319. Drain_Hit
  320. End Sub
  321.  
  322. Sub BallTrap2_Hit()
  323. Drain_Hit
  324. startB2S(4) ' This Line Added By Outhere
  325. End Sub
  326.  
  327. Sub Drain1_Timer()
  328.  
  329. End Sub
  330.  
  331. Sub Drain3_Hit()
  332. Drain_Hit
  333. End Sub
  334.  
  335. sub EjectBall
  336. BallEjector.CreateBall
  337. BallEjector.Kick 0,9
  338. PlaySound SoundFXDOF("Plunger", 110, DOFPulse, DOFFlippers)
  339. startB2S(3) ' This Line Added By Outhere
  340. end sub
  341.  
  342. Sub Col1_Hit()
  343. if P14.rotx = -90 then DOF 117, DOFPulse:DOF 116, DOFPulse:startB2S(18) ' This Line Added By Outhere
  344. ' Col1Lock=2
  345. End Sub
  346.  
  347. Sub Col2_Hit()
  348. if P24.rotx = -90 then DOF 117, DOFPulse:DOF 115, DOFPulse:startB2S(19) ' This Line Added By Outhere
  349. ' Col2Lock=2
  350. End Sub
  351.  
  352. Sub Col3_Hit()
  353. if P34.rotx = -90 then DOF 117, DOFPulse:DOF 114, DOFPulse:DOF 112, DOFPulse:startB2S(2) ' This Line Added By Outhere
  354. ' Col3Lock=2
  355. End Sub
  356.  
  357. Sub Col4_Hit()
  358. if P44.rotx = -90 then DOF 117, DOFPulse:DOF 115, DOFPulse:startB2S(19) ' This Line Added By Outhere
  359. ' Col4Lock=2
  360. End Sub
  361.  
  362. Sub Col5_Hit()
  363. if P54.rotx = -90 then DOF 117, DOFPulse:DOF 116, DOFPulse:startB2S(18) ' This Line Added By Outhere
  364. ' Col5Lock=2
  365. End Sub
  366.  
  367. Sub Col1Row1_Hit()
  368. if P14.rotx = -90 then DOF 117, DOFPulse:startB2S(18) ' This Line Added By Outhere
  369. if P11.rotx = -90 And P14.rotx = 0 then DOF 118, DOFPulse ' This Line Added By Outhere
  370. if P11.rotx = -90 And P14.rotx = 0 And P13.rotx = 0 And P12.rotx = -90 then:startB2S(5) ' This Line Added By Outhere
  371. if P11.rotx = -90 And P14.rotx = 0 And P13.rotx = -90 And P12.rotx = -90 then:startB2S(6) ' This Line Added By Outhere
  372. if P11.rotx = -90 And P14.rotx = 0 And P13.rotx = 0 And P12.rotx = 0 then:startB2S(13) ' This Line Added By Outhere
  373. RaisePiece Flipper11,400
  374. if P11.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(400)
  375. 'P1.Rotx = P1.Rotx + -90
  376.  
  377. if Col1Lock<>2 then
  378. ' Col1Lock=1
  379. end if
  380. End Sub
  381.  
  382. Sub Col2Row1_Hit()
  383. if P24.rotx = -90 then DOF 117, DOFPulse:startB2S(19) ' This Line Added By Outhere
  384. if P21.rotx = -90 And P24.rotx = 0 then DOF 118, DOFPulse ' This Line Added By Outhere
  385. if P21.rotx = -90 And P24.rotx = 0 And P23.rotx = 0 And P22.rotx = -90 then:startB2S(14) ' This Line Added By Outhere
  386. if P21.rotx = -90 And P24.rotx = 0 And P23.rotx = -90 And P22.rotx = -90 then:startB2S(15) ' This Line Added By Outhere
  387. if P21.rotx = -90 And P24.rotx = 0 And P23.rotx = 0 And P22.rotx = 0 then:startB2S(6) ' This Line Added By Outhere
  388. RaisePiece Flipper21,900
  389. if P21.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(900)
  390. 'P2.Rotx = P2.Rotx + -90
  391.  
  392. if Col2Lock<>2 then
  393. ' Col2Lock=1
  394. end if
  395. End Sub
  396.  
  397. Sub Col3Row1_Hit()
  398. if P34.rotx = -90 then DOF 117, DOFPulse:startB2S(2) ' This Line Added By Outhere
  399. if P31.rotx = -90 And P34.rotx = 0 then DOF 118, DOFPulse ' This Line Added By Outhere
  400. if P31.rotx = -90 And P34.rotx = 0 And P33.rotx = 0 And P32.rotx = -90 then:startB2S(16) ' This Line Added By Outhere
  401. if P31.rotx = -90 And P34.rotx = 0 And P33.rotx = -90 And P32.rotx = -90 then:startB2S(10) ' This Line Added By Outhere
  402. if P31.rotx = -90 And P34.rotx = 0 And P33.rotx = 0 And P32.rotx = 0 then:startB2S(15) ' This Line Added By Outhere
  403. RaisePiece Flipper31,1400
  404. if P31.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(1400)
  405. 'P3.Rotx = P3.Rotx + -90
  406.  
  407. if Col3Lock<>2 then
  408. ' Col3Lock=1
  409. end if
  410. End Sub
  411.  
  412. Sub Col4Row1_Hit()
  413. if P44.rotx = -90 then DOF 117, DOFPulse:startB2S(19) ' This Line Added By Outhere
  414. if P41.rotx = -90 And P44.rotx = 0 then DOF 118, DOFPulse ' This Line Added By Outhere
  415. if P41.rotx = -90 And P44.rotx = 0 And P43.rotx = 0 And P42.rotx = -90 then:startB2S(14) ' This Line Added By Outhere
  416. if P41.rotx = -90 And P44.rotx = 0 And P43.rotx = -90 And P42.rotx = -90 then:startB2S(15) ' This Line Added By Outhere
  417. if P41.rotx = -90 And P44.rotx = 0 And P43.rotx = 0 And P42.rotx = 0 then:startB2S(6) ' This Line Added By Outhere
  418. RaisePiece Flipper41,900
  419. if P41.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(900)
  420. 'P4.Rotx = P4.Rotx + -90
  421.  
  422. if Col4Lock<>2 then
  423. ' Col4Lock=1
  424. end if
  425. End Sub
  426.  
  427. Sub Col5Row1_Hit()
  428. if P54.rotx = -90 then DOF 117, DOFPulse:startB2S(18) ' This Line Added By Outhere
  429. if P51.rotx = -90 And P54.rotx = 0 then DOF 118, DOFPulse ' This Line Added By Outhere
  430. if P51.rotx = -90 And P54.rotx = 0 And P53.rotx = 0 And P52.rotx = -90 then:startB2S(5) ' This Line Added By Outhere
  431. if P51.rotx = -90 And P54.rotx = 0 And P53.rotx = -90 And P52.rotx = -90 then:startB2S(6) ' This Line Added By Outhere
  432. if P51.rotx = -90 And P54.rotx = 0 And P53.rotx = 0 And P52.rotx = 0 then:startB2S(13) ' This Line Added By Outhere
  433. RaisePiece Flipper51,400
  434. if P51.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(400)
  435. 'P5.Rotx = P5.Rotx + -90
  436.  
  437. if Col5Lock<>2 then
  438. ' Col5Lock=1
  439. end if
  440. End Sub
  441.  
  442. Sub Col1Row2_Hit()
  443. if P11.rotx = -90 And P12.rotx = -90 And P13.rotx = 0 And P14.rotx = 0 then:startB2S(7) ' This Line Added By Outhere
  444. if P11.rotx = -90 And P12.rotx = -90 And P13.rotx = -90 and P14.rotx = 0 then:startB2S(11) ' This Line Added By Outhere
  445. if P11.rotx = -90 And P12.rotx = -90 And P13.rotx = -90 and P14.rotx = -90 then:startB2S(12) ' This Line Added By Outhere
  446. if Col1Lock <>1 then
  447. RaisePiece Flipper12,300
  448. if P12.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(300):DOF 120, DOFPulse
  449. 'P12.Rotx = P12.Rotx + -90
  450.  
  451. if Col1Lock<>2 then
  452. ' Col1Lock=1
  453. end if
  454. end if
  455. End Sub
  456.  
  457. Sub Col2Row2_Hit()
  458. if P21.rotx = -90 And P22.rotx = -90 And P23.rotx = 0 And P24.rotx = 0 then:startB2S(7) ' This Line Added By Outhere
  459. if P21.rotx = -90 And P22.rotx = -90 And P23.rotx = -90 And P24.rotx = 0 then:startB2S(11) ' This Line Added By Outhere
  460. if P21.rotx = -90 And P22.rotx = -90 And P23.rotx = -90 And P24.rotx = -90 then:startB2S(12) ' This Line Added By Outhere
  461. if Col2Lock <>1 then
  462. RaisePiece Flipper22,300
  463. if P22.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(300):DOF 120, DOFPulse
  464. 'P22.Rotx = P22.Rotx + -90
  465.  
  466. if Col2Lock<>2 then
  467. ' Col2Lock=1
  468. end if
  469. end if
  470. End Sub
  471.  
  472. Sub Col3Row2_Hit()
  473. if P31.rotx = -90 And P32.rotx = -90 And P33.rotx = 0 And P34.rotx = 0 then:startB2S(7) ' This Line Added By Outhere
  474. if P31.rotx = -90 And P32.rotx = -90 And P33.rotx = -90 And P34.rotx = 0 then:startB2S(11) ' This Line Added By Outhere
  475. if P31.rotx = -90 And P32.rotx = -90 And P33.rotx = -90 And P34.rotx = -90 then:startB2S(12) ' This Line Added By Outhere
  476. if Col3Lock <>1 then
  477. RaisePiece Flipper32,300
  478. if P32.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(300):DOF 120, DOFPulse
  479. 'P32.Rotx = P32.Rotx + -90
  480.  
  481. if Col3Lock<>2 then
  482. ' Col3Lock=1
  483. end if
  484. end if
  485. End Sub
  486.  
  487. Sub Col4Row2_Hit()
  488. if P41.rotx = -90 And P42.rotx = -90 And P43.rotx = 0 And P44.rotx = 0 then:startB2S(7) ' This Line Added By Outhere
  489. if P41.rotx = -90 And P42.rotx = -90 And P43.rotx = -90 And P44.rotx = 0 then:startB2S(11) ' This Line Added By Outhere
  490. if P41.rotx = -90 And P42.rotx = -90 And P43.rotx = -90 And P44.rotx = -90 then:startB2S(12) ' This Line Added By Outhere
  491. if Col4Lock <>1 then
  492. RaisePiece Flipper42,300
  493. if P42.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(300):DOF 120, DOFPulse
  494. 'P42.Rotx = P42.Rotx + -90
  495.  
  496. if Col4Lock<>2 then
  497. ' Col4Lock=1
  498. end if
  499. end if
  500. End Sub
  501.  
  502. Sub Col5Row2_Hit()
  503. if P51.rotx = -90 And P52.rotx = -90 And P53.rotx = 0 And P54.rotx = 0 then:startB2S(7) ' This Line Added By Outhere
  504. if P51.rotx = -90 And P52.rotx = -90 And P53.rotx = -90 And P54.rotx = 0 then:startB2S(11) ' This Line Added By Outhere
  505. if P51.rotx = -90 And P52.rotx = -90 And P53.rotx = -90 And P54.rotx = -90 then:startB2S(12) ' This Line Added By Outhere
  506. if Col5Lock <>1 then
  507. RaisePiece Flipper52,300
  508. if P52.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(300):DOF 120, DOFPulse
  509. 'P52.Rotx = P52.Rotx + -90
  510.  
  511. if Col5Lock<>2 then
  512. ' Col5Lock=1
  513. end if
  514. end if
  515. End Sub
  516.  
  517. Sub Col1Row3_Hit()
  518. if P11.rotx = -90 And P12.rotx = -90 And P13.rotx = -90 And P14.rotx = 0 then:startB2S(8) ' This Line Added By Outhere
  519. if P11.rotx = -90 And P12.rotx = -90 And P13.rotx = -90 And P14.rotx = -90 then:startB2S(7) ' This Line Added By Outhere
  520. if Col1Lock <>1 then
  521. RaisePiece Flipper13,200
  522. if P13.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(200):DOF 119, DOFPulse
  523. 'P13.Rotx = P13.Rotx + -90
  524.  
  525. if Col1Lock<>2 then
  526. ' Col1Lock=1
  527. end if
  528. end if
  529. End Sub
  530.  
  531. Sub Col2Row3_Hit()
  532. if P21.rotx = -90 And P22.rotx = -90 And P23.rotx = -90 And P24.rotx = 0 then:startB2S(8) ' This Line Added By Outhere
  533. if P21.rotx = -90 And P22.rotx = -90 And P23.rotx = -90 And P24.rotx = -90 then:startB2S(7) ' This Line Added By Outhere
  534. if Col2Lock <>1 then
  535. RaisePiece Flipper23,200
  536. if P23.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(200):DOF 119, DOFPulse
  537. 'P23.Rotx = P23.Rotx + -90
  538.  
  539. if Col2Lock<>2 then
  540. ' Col2Lock=1
  541. end if
  542. end if
  543. End Sub
  544.  
  545. Sub Col3Row3_Hit()
  546. if P31.rotx = -90 And P32.rotx = -90 And P33.rotx = -90 And P34.rotx = 0 then:startB2S(8) ' This Line Added By Outhere
  547. if P31.rotx = -90 And P32.rotx = -90 And P33.rotx = -90 And P34.rotx = -90 then:startB2S(7) ' This Line Added By Outhere
  548. if Col3Lock <>1 then
  549. RaisePiece Flipper33,200
  550. if P33.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(200):DOF 119, DOFPulse
  551. 'P33.Rotx = P33.Rotx + -90
  552.  
  553. if Col3Lock<>2 then
  554. ' Col3Lock=1
  555. end if
  556. end if
  557. End Sub
  558.  
  559. Sub Col4Row3_Hit()
  560. if P41.rotx = -90 And P42.rotx = -90 And P43.rotx = -90 And P44.rotx = 0 then:startB2S(8) ' This Line Added By Outhere
  561. if P41.rotx = -90 And P42.rotx = -90 And P43.rotx = -90 And P44.rotx = -90 then:startB2S(7) ' This Line Added By Outhere
  562. if Col4Lock <>1 then
  563. RaisePiece Flipper43,200
  564. if P43.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(200):DOF 119, DOFPulse
  565. 'P43.Rotx = P43.Rotx + -90
  566.  
  567. if Col4Lock<>2 then
  568. ' Col4Lock=1
  569. end if
  570. end if
  571. End Sub
  572.  
  573. Sub Col5Row3_Hit()
  574. if P51.rotx = -90 And P52.rotx = -90 And P53.rotx = -90 And P54.rotx = 0 then:startB2S(8) ' This Line Added By Outhere
  575. if P51.rotx = -90 And P52.rotx = -90 And P53.rotx = -90 And P54.rotx = -90 then:startB2S(7) ' This Line Added By Outhere
  576. if Col5Lock <>1 then
  577. RaisePiece Flipper53,200
  578. if P53.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(200):DOF 119, DOFPulse
  579. 'P53.Rotx = P53.Rotx + -90
  580.  
  581. if Col5Lock<>2 then
  582. ' Col5Lock=1
  583. end if
  584. end if
  585. End Sub
  586.  
  587. Sub Col1Row4_Hit()
  588. if P11.rotx = -90 And P13.rotx = -90 then:startB2S(9) ' This Line Added By Outhere
  589. if Col1Lock <>1 then
  590. RaisePiece Flipper14,100
  591. if P14.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(100):DOF 118, DOFPulse
  592. 'P14.Rotx = P14.Rotx + -90
  593.  
  594. end if
  595. Col1Lock=0
  596. End Sub
  597.  
  598. Sub Col2Row4_Hit()
  599. if P21.rotx = -90 And P23.rotx = -90 then:startB2S(9) ' This Line Added By Outhere
  600. if Col2Lock <>1 then
  601. RaisePiece Flipper24,100
  602. if P24.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(100):DOF 118, DOFPulse
  603. 'P24.Rotx = P24.Rotx + -90
  604.  
  605. end if
  606. Col2Lock=0
  607. End Sub
  608.  
  609. Sub Col3Row4_Hit()
  610. if P31.rotx = -90 And P33.rotx = -90 then:startB2S(9) ' This Line Added By Outhere
  611. if Col3Lock <>1 then
  612. RaisePiece Flipper34,100
  613. if P34.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(100):DOF 118, DOFPulse
  614. 'P34.Rotx = P34.Rotx + -90
  615.  
  616. end if
  617. Col3Lock=0
  618. End Sub
  619.  
  620. Sub Col4Row4_Hit()
  621. if P41.rotx = -90 And P43.rotx = -90 then:startB2S(9) ' This Line Added By Outhere
  622. if Col4Lock <>1 then
  623. RaisePiece Flipper44,100
  624. if P44.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(100):DOF 118, DOFPulse
  625. 'P44.Rotx = P44.Rotx + -90
  626.  
  627. end if
  628. Col4Lock=0
  629. End Sub
  630.  
  631. Sub Col5Row4_Hit()
  632. if P51.rotx = -90 And P53.rotx = -90 then:startB2S(9) ' This Line Added By Outhere
  633. if Col5Lock <>1 then
  634. RaisePiece Flipper54,100
  635. if P54.rotx = -90 then playsound SoundFX("Pieceup", DOFContactors):AddScore(100):DOF 118, DOFPulse
  636. 'P54.Rotx = P54.Rotx + -90
  637.  
  638. end if
  639. Col5Lock=0
  640. End Sub
  641.  
  642. sub DropPuzzle
  643. dim oPiece
  644. For Each oPiece In Pieces
  645. oPiece.IsDropped=True
  646. Next
  647. PlaySound "puzzledown"
  648. end sub
  649.  
  650. sub RaisePuzzle
  651. dim oPiece
  652. For Each oPiece In Pieces
  653. oPiece.IsDropped=false
  654. Next
  655. PlaySound "puzzledown"
  656. end sub
  657.  
  658. Sub Piece11_Init()
  659. DropPuzzle
  660. End Sub
  661.  
  662. 'sub RaisePiece(oPiece,intValue)
  663. ' if oPiece.IsDropped=True then
  664. ' oPiece.IsDropped=False
  665. ' PlaySound "pieceup"
  666. ' if boolDoubleScore=True then
  667. ' Score(intValue*2)
  668. ' else
  669. ' Score(intValue)
  670. ' end if
  671. ' end if
  672. 'end sub
  673.  
  674.  
  675. dim rot
  676. Sub RaisePiece(oPiece, rot)
  677. 'If Not rot Is Nothing Then
  678. oPiece.RotateToEnd
  679. End Sub
  680.  
  681. Sub PrimT_Timer
  682. P11.RotX = Flipper11.currentangle
  683. P21.RotX = Flipper21.currentangle
  684. P31.RotX = Flipper31.currentangle
  685. P41.RotX = Flipper41.currentangle
  686. P51.RotX = Flipper51.currentangle
  687. P12.RotX = Flipper12.currentangle
  688. P22.RotX = Flipper22.currentangle
  689. P32.RotX = Flipper32.currentangle
  690. P42.RotX = Flipper42.currentangle
  691. P52.RotX = Flipper52.currentangle
  692. P13.RotX = Flipper13.currentangle
  693. P23.RotX = Flipper23.currentangle
  694. P33.RotX = Flipper33.currentangle
  695. P43.RotX = Flipper43.currentangle
  696. P53.RotX = Flipper53.currentangle
  697. P14.RotX = Flipper14.currentangle
  698. P24.RotX = Flipper24.currentangle
  699. P34.RotX = Flipper34.currentangle
  700. P44.RotX = Flipper44.currentangle
  701. P54.RotX = Flipper54.currentangle
  702. End Sub
  703.  
  704. 'Sub SwitchUnhit(switchno, switch)
  705. ' Controller.Switch(switchno) = False
  706. ' If Not switch Is Nothing Then
  707. ' switch.TransZ = 0
  708. ' End If
  709. 'End Sub
  710.  
  711. 'sub RaisePiece(oPiece,intValue)
  712. ' if oPiece.IsDropped=True then
  713. ' oPiece.IsDropped=False
  714. ' PlaySound "pieceup"
  715. ' if boolDoubleScore=True then
  716. ' Score(intValue*2)
  717. ' else
  718. ' Score(intValue)
  719. ' end if
  720. ' end if
  721. 'end sub
  722.  
  723.  
  724. sub Score(ScoreVal)
  725. intScore=CDbl(intScore)+CDbl(ScoreVal)
  726.  
  727. ScoreReel.AddValue ScoreVal
  728. end sub
  729.  
  730. Sub DoubleScore_Hit()
  731. startB2S(1)
  732. boolDoubleScore=True
  733. Score(intScore)
  734. End Sub
  735.  
  736. Sub ResetTrap_Hit()
  737. ResetTrap.DestroyBall
  738. intBallsLeft=intBallsLeft+1
  739. BallReel.AddValue 1
  740. if b2son then Controller.B2SSetCredits intBallsLeft
  741. if intBallsLeft>9 then
  742. BallGate.IsDropped=False
  743. Divider1.IsDropped=False
  744. Divider2.IsDropped=False
  745. Divider3.IsDropped=False
  746. Divider4.IsDropped=False
  747. if intGameReset=True then
  748. intGameReset=False
  749. DropPuzzle
  750. DoubleScore.Enabled=True
  751. ScoreReel.ResetToZero
  752. intScore=0
  753. boolDoubleScore=False
  754. CheckNewHighScorePostIt1Player PlayerScore
  755. end if
  756. end if
  757.  
  758. End Sub
  759.  
  760. Sub BallStart1_Init()
  761. dim oStart
  762. For Each oStart in BallStart
  763. oStart.CreateBall
  764. oStart.Kick 180,1
  765. next
  766. End Sub
  767.  
  768. Sub HelperKickers_Hit(Index)
  769. HelperKickers(Index).Kick 180,1,-1
  770. End Sub
  771.  
  772.  
  773. '****************** Animated Primitives ****************
  774. sub wall19_hit()
  775. bump1 = 1
  776. Wall19.TimerEnabled = 1
  777. end sub
  778.  
  779. sub Wall19_Timer()
  780. Select Case bump1
  781. Case 1:Primitive82.x = 589.3328:bump1 = bump1 + 1
  782. Case 2:Primitive82.x = 589.0328:bump1 = bump1 + 1
  783. Case 3:Primitive82.x = 589.4028:bump1 = bump1 + 1
  784. Case 4:Primitive82.x = 589.0087:bump1 = bump1 + 1
  785. Case 5:Primitive82.x = 589.2628:bump1 = bump1 + 1
  786. Case 6:Primitive82.x = 589.3328:bump1 = bump1 + 1
  787. case 7:Me.TimerEnabled = 0:bump1 = 0
  788. End Select
  789. end sub
  790.  
  791. sub wall18_hit()
  792. bump2 = 1
  793. Wall18.TimerEnabled = 1
  794. end sub
  795.  
  796. sub Wall18_Timer()
  797. Select Case bump2
  798. Case 1:Primitive36.x = 452:bump2 = bump2 + 1
  799. Case 2:Primitive36.x = 452.0328:bump2 = bump2 + 1
  800. Case 3:Primitive36.x = 452.4028:bump2 = bump2 + 1
  801. Case 4:Primitive36.x = 452.0087:bump2 = bump2 + 1
  802. Case 5:Primitive36.x = 452.3628:bump2 = bump2 + 1
  803. Case 6:Primitive36.x = 452.0328:bump2 = bump2 + 1
  804. case 7:Me.TimerEnabled = 0:bump2 = 0
  805. End Select
  806. end sub
  807.  
  808. sub wall20_hit()
  809. bump3 = 1
  810. Wall20.TimerEnabled = 1
  811. end sub
  812.  
  813. sub Wall20_Timer()
  814. Select Case bump3
  815. Case 1:Primitive81.x = 721.7778:bump3 = bump3 + 1
  816. Case 2:Primitive81.x = 721.4328:bump3 = bump3 + 1
  817. Case 3:Primitive81.x = 721.8028:bump3 = bump3 + 1
  818. Case 4:Primitive81.x = 721.0087:bump3 = bump3 + 1
  819. Case 5:Primitive81.x = 721.8078:bump3 = bump3 + 1
  820. Case 6:Primitive81.x = 721.7778:bump3 = bump3 + 1
  821. case 7:Me.TimerEnabled = 0:bump3 = 0
  822. End Select
  823. end sub
  824.  
  825. sub wall9_hit()
  826. bump4 = 1
  827. Wall9.TimerEnabled = 1
  828. end sub
  829.  
  830. sub Wall9_Timer()
  831. Select Case bump4
  832. Case 1:Primitive83.x = 382.2222:bump4 = bump4 + 1
  833. Case 2:Primitive83.x = 382.0222:bump4 = bump4 + 1
  834. Case 3:Primitive83.x = 382.3222:bump4 = bump4 + 1
  835. Case 4:Primitive83.x = 382.0222:bump4 = bump4 + 1
  836. Case 5:Primitive83.x = 382.4222:bump4 = bump4 + 1
  837. Case 6:Primitive83.x = 382.2222:bump4 = bump4 + 1
  838. case 7:Me.TimerEnabled = 0:bump4 = 0
  839. End Select
  840. end sub
  841.  
  842. sub wall10_hit()
  843. bump5 = 1
  844. Wall10.TimerEnabled = 1
  845. end sub
  846.  
  847. sub Wall10_Timer()
  848. Select Case bump5
  849. Case 1:Primitive84.x = 517.3333:bump5 = bump5 + 1
  850. Case 2:Primitive84.x = 517.1333:bump5 = bump5 + 1
  851. Case 3:Primitive84.x = 517.4333:bump5 = bump5 + 1
  852. Case 4:Primitive84.x = 517.3333:bump5 = bump5 + 1
  853. Case 5:Primitive84.x = 517.0333:bump5 = bump5 + 1
  854. Case 6:Primitive84.x = 517.3333:bump5 = bump5 + 1
  855. case 7:Me.TimerEnabled = 0:bump5 = 0
  856. End Select
  857. end sub
  858.  
  859. sub wall13_hit()
  860. bump6 = 1
  861. Wall13.TimerEnabled = 1
  862. end sub
  863.  
  864. sub Wall13_Timer()
  865. Select Case bump6
  866. Case 1:Primitive85.x = 654.2222:bump6 = bump6 + 1
  867. Case 2:Primitive85.x = 654.0222:bump6 = bump6 + 1
  868. Case 3:Primitive85.x = 654.3222:bump6 = bump6 + 1
  869. Case 4:Primitive85.x = 654.1222:bump6 = bump6 + 1
  870. Case 5:Primitive85.x = 654.4222:bump6 = bump6 + 1
  871. Case 6:Primitive85.x = 654.3222:bump6 = bump6 + 1
  872. case 7:Me.TimerEnabled = 0:bump6 = 0
  873. End Select
  874. end sub
  875.  
  876. sub wall17_hit()
  877. bump7 = 1
  878. Wall17.TimerEnabled = 1
  879. end sub
  880.  
  881. sub Wall17_Timer()
  882. Select Case bump7
  883. Case 1:Primitive86.x = 792.8887:bump7 = bump7 + 1
  884. Case 2:Primitive86.x = 792.6887:bump7 = bump7 + 1
  885. Case 3:Primitive86.x = 792.3887:bump7 = bump7 + 1
  886. Case 4:Primitive86.x = 792.5887:bump7 = bump7 + 1
  887. Case 5:Primitive86.x = 792.9887:bump7 = bump7 + 1
  888. Case 6:Primitive86.x = 792.7887:bump7 = bump7 + 1
  889. case 7:Me.TimerEnabled = 0:bump7 = 0
  890. End Select
  891. end sub
  892.  
  893. '****************************************
  894. ' High Score Post-It support 1.2
  895. '
  896. ' 1. Copy High Score objects from the template backdrop to the desired table's backdrop. Move if needed
  897. ' (Note: In backdrop Options, make sure Enable EMReels is checked. If you check and additions items are displayed, move them off the table)
  898.  
  899. ' 2. Import the 4 Post-It note image files into the table using the Import Manager
  900.  
  901. ' 3. Copy this High Score Post-It script into the table script
  902.  
  903. ' 4. Change the HighScoreFilename, "xxxxHighscorePostIt.txt" below - must be unique for each table
  904.  
  905. ' 5. Add this line to the top of the KeyDown sub: If PostItHighScoreCheck(keycode) then Exit Sub
  906.  
  907. ' 6. Add one of the following lines below to the bottom of the Game Over sub of the table.
  908. ' Note: Each table is different, you will have to figure out the scoring variable and the game over/match over subroutine
  909. ' Replace xxxx with the variable used to track scoring, usually Score, Score(1), Score1, PlayerScore, etc
  910. ' CheckNewHighScorePostIt1Player PlayerScore '1 player table
  911. ' CheckNewHighScorePostIt2Player xxx1, xxx2 '2 player table
  912. ' CheckNewHighScorePostIt3Player xxx1, xxx2, xxx3 '3 player table
  913. ' CheckNewHighScorePostIt4Player xxx1, xxx2, xxx3, xxx4 '4 player table
  914. '****************************************
  915. Const HighScoreFilename = "jigsaw.txt"
  916.  
  917. Dim HSAHighScore, HSA1, HSA2, HSA3
  918. Dim HSScore100k, HSScore10k, HSScoreK, HSScore100, HSScore10, HSScore1, HSScorex 'Define 5 different score values for each reel to use
  919. Dim HSEnterMode, hsLetterFlash, hsEnteredDigits(3), hsCurrentDigit, hsCurrentLetter
  920. Const hsFlashDelay = 4
  921. Const DefaultHighScore = 10
  922. Const DefaultHSA1 = 78
  923. Const DefaultHSA2 = 74
  924. Const DefaultHSA3 = 78
  925.  
  926. LoadHighScore
  927. Sub LoadHighScore
  928. Dim FileObj
  929. Dim ScoreFile
  930. Dim TextStr
  931. Dim SavedDataTemp3 'HighScore
  932. Dim SavedDataTemp4 'HSA1
  933. Dim SavedDataTemp5 'HSA2
  934. Dim SavedDataTemp6 'HSA3
  935. Set FileObj=CreateObject("Scripting.FileSystemObject")
  936. If Not FileObj.FolderExists(UserDirectory) then
  937. Exit Sub
  938. End if
  939. If Not FileObj.FileExists(UserDirectory & HighScoreFilename) then
  940. SetDefaultHSTD:UpdatePostIt:SaveHighScore
  941. Exit Sub
  942. End if
  943. Set ScoreFile=FileObj.GetFile(UserDirectory & HighScoreFilename)
  944. Set TextStr=ScoreFile.OpenAsTextStream(1,0)
  945. If (TextStr.AtEndOfStream=True) then
  946. SetDefaultHSTD:UpdatePostIt:SaveHighScore
  947. Exit Sub
  948. End if
  949. SavedDataTemp3=Textstr.ReadLine ' HighScore
  950. SavedDataTemp4=Textstr.ReadLine ' HSA1
  951. SavedDataTemp5=Textstr.ReadLine ' HSA2
  952. SavedDataTemp6=Textstr.ReadLine ' HSA3
  953. TextStr.Close
  954. HSAHighScore=SavedDataTemp3
  955. HSA1=SavedDataTemp4
  956. HSA2=SavedDataTemp5
  957. HSA3=SavedDataTemp6
  958. UpdatePostIt
  959. Set ScoreFile = Nothing
  960. Set FileObj = Nothing
  961. End Sub
  962.  
  963. Sub SetDefaultHSTD 'bad data or missing file - reset and resave
  964. HSAHighScore = DefaultHighScore
  965. HSA1 = DefaultHSA1
  966. HSA2 = DefaultHSA2
  967. HSA3 = DefaultHSA3
  968. SaveHighScore
  969. End Sub
  970.  
  971. Sub LastScoreReels
  972. HSScorex = LastScore
  973. HSScore100K=Int (HSScorex/100000)'Calculate the value for the 100,000's digit
  974. HSScore10K=Int ((HSScorex-(HSScore100k*100000))/10000) 'Calculate the value for the 10,000's digit
  975. HSScoreK=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000))/1000) 'Calculate the value for the 1000's digit
  976. HSScore100=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000))/100) 'Calculate the value for the 100's digit
  977. HSScore10=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000)-(HSScore100*100))/10) 'Calculate the value for the 10's digit
  978. HSScore1=Int(HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000)-(HSScore100*100)-(HSScore10*10)) 'Calculate the value for the 1's digit
  979.  
  980. End Sub
  981.  
  982. Sub UpdatePostIt
  983. HSScorex = HSAHighScore
  984. HSScore100K=Int (HSScorex/100000)'Calculate the value for the 100,000's digit
  985. HSScore10K=Int ((HSScorex-(HSScore100k*100000))/10000) 'Calculate the value for the 10,000's digit
  986. HSScoreK=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000))/1000) 'Calculate the value for the 1000's digit
  987. HSScore100=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000))/100) 'Calculate the value for the 100's digit
  988. HSScore10=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000)-(HSScore100*100))/10) 'Calculate the value for the 10's digit
  989. HSScore1=Int(HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000)-(HSScore100*100)-(HSScore10*10)) 'Calculate the value for the 1's digit
  990. EMReelHSNum1.SetValue(HSScore100K):If HSScorex<100000 Then EMReelHSNum1.SetValue 10
  991. EMReelHSNum2.SetValue(HSScore10K):If HSScorex<10000 Then EMReelHSNum2.SetValue 10
  992. EMReelHSNum3.SetValue(HSScoreK):If HSScorex<1000 Then EMReelHSNum3.SetValue 10:EMReelHSComma.SetValue 0:Else EMReelHSComma.SetValue 1
  993. EMReelHSNum4.SetValue(HSScore100):If HSScorex<100 Then EMReelHSNum4.SetValue 10
  994. EMReelHSNum5.SetValue(HSScore10):If HSScorex<10 Then EMReelHSNum5.SetValue 10
  995. EMReelHSNum6.SetValue(HSScore1)
  996. EMReelHSName1.SetValue HSA1
  997. EMReelHSName2.SetValue HSA2
  998. EMReelHSName3.SetValue HSA3
  999. End Sub
  1000.  
  1001. Sub SaveHighScore
  1002. Dim FileObj
  1003. Dim ScoreFile
  1004. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1005. If Not FileObj.FolderExists(UserDirectory) then
  1006. Exit Sub
  1007. End if
  1008. Set ScoreFile=FileObj.CreateTextFile(UserDirectory & HighScoreFilename,True)
  1009. ScoreFile.WriteLine HSAHighScore
  1010. ScoreFile.WriteLine HSA1
  1011. ScoreFile.WriteLine HSA2
  1012. ScoreFile.WriteLine HSA3
  1013. ScoreFile.Close
  1014. Set ScoreFile=Nothing
  1015. Set FileObj=Nothing
  1016. End Sub
  1017.  
  1018. Sub HighScoreEntryInit()
  1019. HSEnterMode = True
  1020. hsCurrentDigit = 0
  1021. hsCurrentLetter = 1:HSA1=1
  1022. HighScoreFlashTimer.Interval = 250
  1023. HighScoreFlashTimer.Enabled = True
  1024. hsLetterFlash = hsFlashDelay
  1025. End Sub
  1026.  
  1027. Sub HighScoreFlashTimer_Timer()
  1028. hsLetterFlash = hsLetterFlash-1
  1029. If hsLetterFlash=1 then 'switch to underscore
  1030. Select Case hsCurrentLetter
  1031. Case 1:
  1032. EMReelHSName1.SetValue 28
  1033. Case 2:
  1034. EMReelHSName2.SetValue 28
  1035. Case 3:
  1036. EMReelHSName3.SetValue 28
  1037. End Select
  1038. End If
  1039. If hsLetterFlash=0 then 'switch back
  1040. hsLetterFlash = hsFlashDelay
  1041. Select Case hsCurrentLetter
  1042. Case 1:
  1043. EMReelHSName1.SetValue HSA1
  1044. Case 2:
  1045. EMReelHSName2.SetValue HSA2
  1046. Case 3:
  1047. EMReelHSName3.SetValue HSA3
  1048. End Select
  1049. End If
  1050. End Sub
  1051.  
  1052. Sub HighScoreProcessKey(keycode)
  1053. If keycode = LeftFlipperKey Then
  1054. hsLetterFlash = hsFlashDelay
  1055. Select Case hsCurrentLetter
  1056. Case 1:
  1057. HSA1=HSA1-1:If HSA1=-1 Then HSA1=26 'no backspace on 1st digit
  1058. UpdatePostIt
  1059. Case 2:
  1060. HSA2=HSA2-1:If HSA2=-1 Then HSA2=27
  1061. UpdatePostIt
  1062. Case 3:
  1063. HSA3=HSA3-1:If HSA3=-1 Then HSA3=27
  1064. UpdatePostIt
  1065. End Select
  1066. End If
  1067.  
  1068. If keycode = RightFlipperKey Then
  1069. hsLetterFlash = hsFlashDelay
  1070. Select Case hsCurrentLetter
  1071. Case 1:
  1072. HSA1=HSA1+1:If HSA1>27 Then HSA1=0
  1073. UpdatePostIt
  1074. Case 2:
  1075. HSA2=HSA2+1:If HSA2>27 Then HSA2=0
  1076. UpdatePostIt
  1077. Case 3:
  1078. HSA3=HSA3+1:If HSA3>27 Then HSA3=0
  1079. UpdatePostIt
  1080. End Select
  1081. End If
  1082.  
  1083. If keycode = StartGameKey Then
  1084. Select Case hsCurrentLetter
  1085. Case 1:
  1086. hsCurrentLetter=2 'ok to advance
  1087. HSA2=HSA1 'start at same alphabet spot
  1088. EMReelHSName1.SetValue HSA1:EMReelHSName2.SetValue HSA2
  1089. Case 2:
  1090. If HSA2=27 Then 'bksp
  1091. HSA2=0
  1092. hsCurrentLetter=1
  1093. Else
  1094. hsCurrentLetter=3 'enter it
  1095. HSA3=HSA2 'start at same alphabet spot
  1096. End If
  1097. EMReelHSName2.SetValue HSA2:EMReelHSName3.SetValue HSA3
  1098. Case 3:
  1099. If HSA3=27 Then 'bksp
  1100. HSA3=0
  1101. hsCurrentLetter=2
  1102. Else
  1103. SaveHighScore 'enter it
  1104. HighScoreFlashTimer.Enabled = False
  1105. HSEnterMode = False
  1106.  
  1107. UpdatePostIt
  1108. EMReelHSTitle.SetValue 0
  1109. End If
  1110. EMReelHSName3.SetValue HSA3
  1111. End Select
  1112. End If
  1113. End Sub
  1114.  
  1115. Function PostItHighScoreCheck (keycode)
  1116. PostItHighScoreCheck = 0
  1117. If HSEnterMode Then
  1118. HighScoreProcessKey(keycode)
  1119.  
  1120. Select Case keycode
  1121. Case LeftFlipperKey, RightFlipperKey, 2, StartGameKey
  1122. PostItHighScoreCheck = 1
  1123. End Select
  1124. End If
  1125. End Function
  1126.  
  1127. Sub CheckNewHighScorePostIt (newScore)
  1128. If CLng(newScore) > CLng(HSAHighScore) Then
  1129. HSAHighScore=newScore:HSA1 = 0:HSA2 = 0:HSA3 = 0:UpdatePostIt
  1130. EMReelHSTitle.SetValue 1
  1131. HighScoreEntryInit()
  1132. End If
  1133. End Sub
  1134. Sub CheckNewHighScorePostIt1Player (newScore1)
  1135. CheckNewHighScorePostIt newScore1
  1136. End Sub
  1137. Sub CheckNewHighScorePostIt2Player (newScore1, newScore2)
  1138. Dim bestscore
  1139. bestscore = newScore1
  1140. If newScore2 > bestscore then bestscore = newScore2
  1141. CheckNewHighScorePostIt bestscore
  1142. End Sub
  1143. Sub CheckNewHighScorePostIt3Player (newScore1, newScore2, newScore3)
  1144. Dim bestscore
  1145. bestscore = newScore1
  1146. If newScore2 > bestscore then bestscore = newScore2
  1147. If newScore3 > bestscore then bestscore = newScore3
  1148. CheckNewHighScorePostIt bestscore
  1149. End Sub
  1150. Sub CheckNewHighScorePostIt4Player (newScore1, newScore2, newScore3, newScore4)
  1151. Dim bestscore
  1152. bestscore = newScore1
  1153. If newScore2 > bestscore then bestscore = newScore2
  1154. If newScore3 > bestscore then bestscore = newScore3
  1155. If newScore4 > bestscore then bestscore = newScore4
  1156. CheckNewHighScorePostIt bestscore
  1157. End Sub
  1158.  
  1159.  
  1160. '*******************************RAIL SOUNDS *******************************
  1161. Sub RCol1_Hit()
  1162. dim finalspeed
  1163. StopSound "fx_ballrolling"
  1164. PlaySound "rail_low_slower", 0, (Vol(ActiveBall)*.75), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0:End Sub
  1165.  
  1166. Sub Rcol1d_Hit()
  1167. StopSound "rail"
  1168. StopSound "rail_low_slower"
  1169. PlaySound "ball_bounce",0,1,.3,0
  1170. End Sub
  1171.  
  1172. Sub RCol2_Hit()
  1173. dim finalspeed
  1174. StopSound "fx_ballrolling"
  1175. PlaySound "rail_low_slower", 0, (Vol(ActiveBall)*.75), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0:End Sub
  1176.  
  1177. Sub Rcol2d_Hit()
  1178. StopSound "rail"
  1179. StopSound "rail_low_slower"
  1180. PlaySound "ball_bounce",0,1,.3,0
  1181. End Sub
  1182.  
  1183. Sub RCol3_Hit()
  1184. dim finalspeed
  1185. StopSound "fx_ballrolling"
  1186. PlaySound "rail_low_slower", 0, (Vol(ActiveBall)*.75), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0:End Sub
  1187.  
  1188. Sub Rcol3d_Hit()
  1189. StopSound "rail"
  1190. StopSound "rail_low_slower"
  1191. PlaySound "ball_bounce",0,1,.3,0
  1192. End Sub
  1193.  
  1194. Sub RCol4_Hit()
  1195. dim finalspeed
  1196. StopSound "fx_ballrolling"
  1197. PlaySound "rail_low_slower", 0, (Vol(ActiveBall)*.75), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0:End Sub
  1198.  
  1199. Sub Rcol4d_Hit()
  1200. StopSound "rail"
  1201. StopSound "rail_low_slower"
  1202. PlaySound "ball_bounce",0,1,.3,0
  1203. End Sub
  1204.  
  1205. Sub RCol5_Hit()
  1206. dim finalspeed
  1207. StopSound "fx_ballrolling"
  1208. PlaySound "rail_low_slower", 0, (Vol(ActiveBall)*.75), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0:End Sub
  1209.  
  1210. Sub Rcol5d_Hit()
  1211. StopSound "rail"
  1212. StopSound "rail_low_slower"
  1213. PlaySound "ball_bounce",0,1,.3,0
  1214. End Sub
  1215.  
  1216. Sub draind_Hit()
  1217. PlaySound "ball_bounce",0,1,.3,0
  1218. End Sub
  1219.  
  1220.  
  1221. Sub draind1_Hit()
  1222. PlaySound "ball_bounce",0,1,.3,0
  1223. End Sub
  1224.  
  1225.  
  1226.  
  1227.  
  1228. ' *********************************************************************
  1229. ' Supporting Ball & Sound Functions
  1230. ' *********************************************************************
  1231.  
  1232. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1233. Vol = Csng(BallVel(ball) ^20 / 2000)
  1234. End Function
  1235.  
  1236. Function Vol2(ball1, ball2) ' Calculates the Volume of the sound based on the speed of two balls
  1237. Vol2 = (Vol(ball1) + Vol(ball2) ) / 2
  1238. End Function
  1239.  
  1240. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1241. Dim tmp
  1242. tmp = ball.x * 2 / table1.width-1
  1243. If tmp> 0 Then
  1244. Pan = Csng(tmp ^10)
  1245. Else
  1246. Pan = Csng(-((- tmp) ^10) )
  1247. End If
  1248. End Function
  1249.  
  1250. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1251. Pitch = BallVel(ball) * 20
  1252. End Function
  1253.  
  1254. Function BallVel(ball) 'Calculates the ball speed
  1255. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1256. End Function
  1257.  
  1258. '*****************************************
  1259. ' JP's VP10 Collision & Rolling Sounds
  1260. '*****************************************
  1261.  
  1262. Const tnob = 20 ' total number of balls
  1263. ReDim rolling(tnob)
  1264. ReDim collision(tnob)
  1265. Initcollision
  1266.  
  1267. Sub Initcollision
  1268. Dim i
  1269. For i = 0 to tnob
  1270. collision(i) = -1
  1271. rolling(i) = False
  1272. Next
  1273. End Sub
  1274.  
  1275. Sub CollisionTimer_Timer()
  1276. Dim BOT, B, B1, B2, dx, dy, dz, distance, radii
  1277. BOT = GetBalls
  1278.  
  1279. ' rolling
  1280.  
  1281. For B = UBound(BOT) +1 to tnob
  1282. rolling(b) = False
  1283. StopSound("fx_ballrolling" & b)
  1284. Next
  1285.  
  1286. If UBound(BOT) = -1 Then Exit Sub
  1287.  
  1288. For B = 0 to UBound(BOT)
  1289. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 100 Then
  1290. rolling(b) = True
  1291. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1292. Else
  1293. If rolling(b) = True Then
  1294. StopSound("fx_ballrolling" & b)
  1295. rolling(b) = False
  1296. End If
  1297. End If
  1298. Next
  1299.  
  1300. 'collision
  1301.  
  1302. If UBound(BOT) < 1 Then Exit Sub
  1303.  
  1304. For B1 = 0 to UBound(BOT)
  1305. For B2 = B1 + 1 to UBound(BOT)
  1306. dz = INT(ABS((BOT(b1).z - BOT(b2).z) ) )
  1307. radii = BOT(b1).radius + BOT(b2).radius
  1308. If dz <= radii Then
  1309.  
  1310. dx = INT(ABS((BOT(b1).x - BOT(b2).x) ) )
  1311. dy = INT(ABS((BOT(b1).y - BOT(b2).y) ) )
  1312. distance = INT(SQR(dx ^2 + dy ^2) )
  1313.  
  1314. If distance <= radii AND (collision(b1) = -1 OR collision(b2) = -1) Then
  1315. collision(b1) = b2
  1316. collision(b2) = b1
  1317. PlaySound("fx_collide"), 0, Vol2(BOT(b1), BOT(b2)), Pan(BOT(b1)), 0, Pitch(BOT(b1)), 0, 0
  1318. Else
  1319. If distance > (radii + 1) Then
  1320. If collision(b1) = b2 Then collision(b1) = -1
  1321. If collision(b2) = b1 Then collision(b2) = -1
  1322. End If
  1323. End If
  1324. End If
  1325. Next
  1326. Next
  1327. End Sub
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334. '************************************
  1335. ' What you need to add to your table
  1336. '************************************
  1337.  
  1338. ' a timer called CollisionTimer. With a fast interval, like from 1 to 10
  1339. ' one collision sound, in this script is called fx_collide
  1340. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  1341. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  1342.  
  1343.  
  1344. '******************************************
  1345. ' Explanation of the rolling sound routine
  1346. '******************************************
  1347.  
  1348. ' sounds are played based on the ball speed and position
  1349.  
  1350. ' the routine checks first for deleted balls and stops the rolling sound.
  1351.  
  1352. ' The For loop goes through all the balls on the table and checks for the ball speed and
  1353. ' if the ball is on the table (height lower than 30) then then it plays the sound
  1354. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  1355.  
  1356. ' The sound is played using the VOL, PAN and PITCH functions, so the volume and pitch of the sound
  1357. ' will change according to the ball speed, and the PAN function will change the stereo position according
  1358. ' to the position of the ball on the table.
  1359.  
  1360.  
  1361. '**************************************
  1362. ' Explanation of the collision routine
  1363. '**************************************
  1364.  
  1365. ' The Double For loop: This is a double cycle used to check the collision between a ball and the other ones.
  1366. ' If you look at the parameters of both cycles, you?ll notice they are designed to avoid checking
  1367. ' collision twice. For example, I will never check collision between ball 2 and ball 1,
  1368. ' because I already checked collision between ball 1 and 2. So, if we have 4 balls,
  1369. ' the collision checks will be: ball 1 with 2, 1 with 3, 1 with 4, 2 with 3, 2 with 4 and 3 with 4.
  1370.  
  1371. ' Sum first the radius of both balls, and if the height between them is higher then do not calculate anything more,
  1372. ' since the balls are on different heights so they can't collide.
  1373.  
  1374. ' The next 3 lines calculates distance between xth and yth balls with the Pytagorean theorem,
  1375.  
  1376. ' The first "If": Checking if the distance between the two balls is less than the sum of the radius of both balls,
  1377. ' and both balls are not already colliding.
  1378.  
  1379. ' Why are we checking if balls are already in collision?
  1380. ' Because we do not want the sound repeting when two balls are resting closed to each other.
  1381.  
  1382. ' Set the collision property of both balls to True, and we assign the number of the ball colliding
  1383.  
  1384. ' Play the collide sound of your choice using the VOL, PAN and PITCH functions
  1385.  
  1386. ' Last lines: If the distance between 2 balls is more than the radius of a ball,
  1387. ' then there is no collision and then set the collision property of the ball to False (-1).
  1388.  
  1389.  
  1390. Sub Pins_Hit (idx)
  1391. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1392. End Sub
  1393.  
  1394. Sub spring_Hit (idx)
  1395. PlaySound "spring", 10, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1396. End Sub
  1397.  
  1398. Sub nails_Hit (idx)
  1399. PlaySound "post hit", 10, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1400. End Sub
  1401.  
  1402. Sub Metals_Hit (idx)
  1403. PlaySound "metal", 10, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1404. End Sub
  1405.  
  1406. Sub Metals2_Hit (idx)
  1407. PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1408. End Sub
  1409.  
  1410. Sub Gates_Hit (idx)
  1411. PlaySound "gate", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1412. End Sub
  1413.  
  1414. Sub Spinner_Spin
  1415. PlaySound "fx_spinner",0,.25,0,0.25
  1416. End Sub
  1417.  
  1418. Sub rubbers_Hit(idx)
  1419. dim finalspeed
  1420. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1421. If finalspeed > 1 then
  1422. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1423. End if
  1424. If finalspeed >= 6 AND finalspeed <= 1 then
  1425. RandomSoundRubber()
  1426. End If
  1427. End Sub
  1428.  
  1429. Sub Posts_Hit(idx)
  1430. dim finalspeed
  1431. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1432. If finalspeed > 16 then
  1433. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1434. End if
  1435. If finalspeed >= 6 AND finalspeed <= 16 then
  1436. RandomSoundRubber()
  1437. End If
  1438. End Sub
  1439.  
  1440. Sub RandomSoundRubber()
  1441. Select Case Int(Rnd*3)+1
  1442. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1443. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1444. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1445. End Select
  1446. End Sub
  1447.  
  1448. Sub LeftFlipper_Collide(parm)
  1449. RandomSoundFlipper()
  1450. End Sub
  1451.  
  1452. Sub RightFlipper_Collide(parm)
  1453. RandomSoundFlipper()
  1454. End Sub
  1455.  
  1456. Sub RandomSoundFlipper()
  1457. Select Case Int(Rnd*3)+1
  1458. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1459. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1460. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1461. End Select
  1462. End Sub
  1463.  
  1464. Sub Table1_Exit
  1465. Controller.Stop
  1466. End Sub
Advertisement
Add Comment
Please, Sign In to add comment