Arngrim

Untitled

Jan 20th, 2018
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.07 KB | None | 0 0
  1. ' -------------------------------------------------
  2. ' Darling Williams 1973, based on Gottlieb EM 4 player VPX table blank with options menu
  3. ' -------------------------------------------------
  4. '
  5. ' BorgDog, 2018
  6. '
  7. ' High Score sticky routines from mfuegemann's Fast Draw VPX table
  8. ' - flippers to change letter, Start to Select
  9. ' Ball control script from rothbauerw
  10. ' - press C during play to control ball, use arrows to move the ball
  11. ' Option menu and player up light rotation borrowed from loserman76 and gnance
  12. ' - hold down left shift during Game Over to bring up menu
  13. ' Ball shadows from ninuzzu
  14. ' - set option below to enable or disable
  15. ' primitives from Dark, zany, sliderpoint, hauntfreaks and I'm sure others
  16. '
  17. ' Layer usage generally
  18. ' 1 - most stuff
  19. ' 2 - triggers
  20. ' 3 - under apron walls and ramps
  21. ' 4 - options menu
  22. ' 5 - hi score sticky
  23. ' 6 - GI lighting
  24. ' 7 - plastics
  25. ' 8 - insert and bumper lighting
  26. '
  27. ' Basic DOF config, may not be accurate and definitely need to change to match a particular game
  28. ' 101 Left Flipper, 102 Right Flipper,
  29. ' 103 Left sling/kicker, 104 Left sling flasher, 105 right sling/kicker, 106 right sling flasher,
  30. ' 107 Bumper1, 108 Bumper1 flasher, 109 bumper2, 110 bumper2 Flasher
  31. ' 134 Drain, 135 Ball Release
  32. ' 136 Shooter Lane/launch ball, 137 credit light, 138 knocker, 139 knocker/kicker Flasher
  33. ' 141 Chime1-10s, 142 Chime2-100s, 143 Chime3-1000s
  34. '
  35. ' -------------------------------------------------
  36.  
  37. Option Explicit
  38. Randomize
  39.  
  40. Const cGameName = "darling"
  41. Const Ballsize = 50
  42.  
  43.  
  44. '**********************************************************
  45. '******** OPTIONS *******************************
  46. '**********************************************************
  47.  
  48. Dim BallShadows: Ballshadows=1 '******************set to 1 to turn on Ball shadows
  49. Dim FlipperShadows: FlipperShadows=1 '***********set to 1 to turn on Flipper shadows
  50.  
  51. Dim operatormenu, options
  52. Dim bumperlitscore
  53. Dim bumperoffscore
  54. Dim balls, TempPlayerUp, rotatortemp
  55. Dim replays, freeplay
  56. Dim Replay1Table(3), Replay2Table(3), Replay3Table(3)
  57. dim replay1, replay2, replay3
  58. Dim Add10, Add100, Add1000
  59. Dim hisc, LeftBalls, RightBalls
  60. Dim maxplayers, players, player
  61. Dim credit, ebmode
  62. Dim score(4), bonus, extraadvance, chimescount, dbonus
  63. Dim state
  64. Dim tilt, tiltsens
  65. Dim ballinplay
  66. Dim matchnumb
  67. dim rstep, lstep
  68. Dim rep(4)
  69. Dim rst
  70. Dim eg
  71. Dim bell
  72. Dim i,j, ii, objekt, light
  73. Dim awardcheck
  74.  
  75. On Error Resume Next
  76. ExecuteGlobal GetTextFile("controller.vbs")
  77. If Err Then MsgBox "Can't open controller.vbs"
  78. On Error Goto 0
  79.  
  80.  
  81. sub Darling_init
  82. LoadEM
  83. maxplayers=2
  84. Replay1Table(1)=47000
  85. Replay2Table(1)=63000
  86. Replay3Table(1)=79000
  87. Replay1Table(2)=64000
  88. Replay2Table(2)=73000
  89. Replay3Table(2)=99000
  90. hideoptions
  91. player=1
  92. RotatorTemp=1
  93. balls=5 'SET DEFAULT VALUES PRIOR TO LOADING FROM SAVED FILE
  94. ebmode=0
  95. freeplay=0
  96. leftballs=3
  97. rightballs=2
  98. hisc=10000
  99. HSA1=4
  100. HSA2=15
  101. HSA3=7
  102. matchnumb=0
  103. loadhs 'LOADS SAVED OPTIONS AND HIGH SCORE IF EXISTING
  104. UpdatePostIt 'UPDATE HIGH SCORE STICKY
  105. for i = 1 to maxplayers
  106. EVAL("ScoreReel"&i).setvalue score(i)
  107. EVAL("Reel100K"&i).setvalue(int(score(i)/100000))
  108. next
  109.  
  110. if balls=3 then
  111. replays=1
  112. else
  113. replays=2
  114. end if
  115.  
  116. bipreel.setvalue 0
  117. if freeplay=0 then credittxt.setvalue(credit)
  118. Replay1=Replay1Table(Replays)
  119. Replay2=Replay2Table(Replays)
  120. Replay3=Replay3Table(Replays)
  121. if ebmode = 0 then
  122. RepCard.image = "ReplayCard"&Balls&"Balls"
  123. else
  124. Repcard.image = "ReplayCard"&balls&"BallsEB"
  125. end if
  126. OptionBalls.image="OptionsBalls"&Balls
  127. OptionReplays.image="OptionReplays"&ebmode
  128. OptionFreeplay.image="OptionsFreeplay"&freeplay
  129. bumperlitscore=100
  130. bumperoffscore=100
  131. if balls=3 then
  132. extraadvance=4
  133. else
  134. extraadvance=3
  135. end if
  136.  
  137. if ebmode=0 then
  138. InstCard.image="InstCardReplay"
  139. else
  140. InstCard.image="InstCardEB"
  141. end if
  142.  
  143. If B2SOn then
  144. for each objekt in backdropstuff : objekt.visible = 0 : next
  145. End If
  146. startGame.enabled=true
  147. tilt=false
  148. turnoff
  149.  
  150.  
  151. if ballshadows=1 then
  152. BallShadowUpdate.enabled=1
  153. else
  154. BallShadowUpdate.enabled=0
  155. end if
  156.  
  157. if flippershadows=1 then
  158. FlipperLSh.visible=1
  159. FlipperRSh.visible=1
  160. else
  161. FlipperLSh.visible=0
  162. FlipperRSh.visible=0
  163. end if
  164. KcaptiveL.uservalue=1
  165. KcaptiveL.timerenabled=1
  166. Drain.CreateBall
  167. End sub
  168.  
  169. Sub KcaptiveL_timer
  170. Select Case (me.uservalue)
  171. Case 1:
  172. if leftballs>0 then
  173. KcaptiveL.createball
  174. KcaptiveL.kick 180,1
  175. end if
  176. if rightballs>0 then
  177. KcaptiveR.createball
  178. kcaptiveR.kick 180,1
  179. end if
  180. Case 2:
  181. if leftballs>1 then
  182. KcaptiveL.createball
  183. KcaptiveL.kick 180,1
  184. end if
  185. if rightballs>1 then
  186. KcaptiveR.createball
  187. kcaptiveR.kick 180,1
  188. end if
  189. Case 3:
  190. if leftballs>2 then
  191. KcaptiveL.createball
  192. KcaptiveL.kick 180,1
  193. end if
  194. if rightballs>2 then
  195. KcaptiveR.createball
  196. kcaptiveR.kick 180,1
  197. end if
  198. Case 4:
  199. if leftballs>3 then
  200. KcaptiveL.createball
  201. KcaptiveL.kick 180,1
  202. end if
  203. if rightballs>3 then
  204. KcaptiveR.createball
  205. kcaptiveR.kick 180,1
  206. end if
  207. Case 5:
  208. if leftballs>4 then
  209. KcaptiveL.createball
  210. KcaptiveL.kick 180,1
  211. end if
  212. if rightballs>4 then
  213. KcaptiveR.createball
  214. kcaptiveR.kick 180,1
  215. end if
  216. Case 6:
  217. me.timerenabled=0
  218. PairedlampTimer.enabled=1
  219. End Select
  220. me.uservalue=me.uservalue+1
  221. end sub
  222.  
  223. sub startGame_timer
  224. PlaySoundAtVol "poweron", Plunger, 1
  225. lightdelay.enabled=true
  226. me.enabled=false
  227. end sub
  228.  
  229. sub lightdelay_timer
  230. gamov.text="GAME OVER"
  231. if ebmode=0 then
  232. if matchnumb=0 then
  233. matchtxt.text="00"
  234. else
  235. matchtxt.text=matchnumb*10
  236. end if
  237. end if
  238. If (credit>0 and freeplay=0) or freeplay=1 then
  239. DOF 137, DOFOn
  240. Lcredit.state=1
  241. end if
  242. For each light in GIlights:light.state=1:Next
  243. if B2SOn then
  244. for i = 1 to maxplayers
  245. Controller.B2SSetScorePlayer i, Score(i) MOD 100000
  246. next
  247. Controller.B2SSetData 1,1
  248. if freeplay=0 then Controller.B2ssetCredits Credit
  249. if ebmode=0 then Controller.B2ssetMatch 34, Matchnumb
  250. Controller.B2SSetGameOver 35,1
  251. end if
  252. me.enabled=0
  253. end Sub
  254.  
  255.  
  256.  
  257. Sub Darling_KeyDown(ByVal keycode)
  258.  
  259. if keycode = 46 then' C Key
  260. If contball = 1 Then
  261. contball = 0
  262. Else
  263. contball = 1
  264. End If
  265. End If
  266.  
  267. if keycode = 48 then 'B Key
  268. If bcboost = 1 Then
  269. bcboost = bcboostmulti
  270. Else
  271. bcboost = 1
  272. End If
  273. End If
  274.  
  275. if keycode = 203 then Cleft = 1' Left Arrow
  276.  
  277. if keycode = 200 then Cup = 1' Up Arrow
  278.  
  279. if keycode = 208 then Cdown = 1' Down Arrow
  280.  
  281. if keycode = 205 then Cright = 1' Right Arrow
  282.  
  283. if keycode=AddCreditKey then
  284. if freeplay=1 or credit>24 then
  285. PlaySoundAtVol "coinreturn", Drain, 1
  286. else
  287. PlaySoundAtVol "coinin" , Drain, 1
  288. coindelay.enabled=true
  289. end if
  290. end if
  291.  
  292. if keycode=StartGameKey and (Credit>0 or freeplay=1) And Not lightdelay.enabled and Not startGame.enabled and Not HSEnterMode=true then
  293. if state=false then
  294. player=1
  295. if freeplay=0 then
  296. credit=credit-1
  297. if credit < 1 then
  298. DOF 137, DOFOff
  299. Lcredit.state=0
  300. end if
  301. credittxt.setvalue(credit)
  302. End if
  303. PlaySound "cluper"
  304. ballinplay=1
  305. If B2SOn Then
  306. if freeplay=0 then Controller.B2ssetCredits Credit
  307. Controller.B2ssetballinplay 32, Ballinplay
  308. Controller.B2ssetplayerup 30, 1
  309. Controller.B2ssetcanplay 31, 1
  310. Controller.B2SSetGameOver 0
  311. Controller.B2SSetScorePlayer 5, hisc
  312. End If
  313. for i = 1 to maxplayers
  314. score(i)=0
  315. rep(i)=0
  316. EVAL("Pup"&i).state=0
  317. EVAL("PupN"&i).state=0
  318. EVAL("ScoreReel"&i).resettozero
  319. EVAL("Reel100K"&i).setvalue 0
  320. If B2SOn then Controller.B2SSetScorePlayer i, score(i)
  321. next
  322. Pup1.state=1
  323. PupN1.state=1
  324. ' PlaySound("RotateThruPlayers"),0,.05,0,0.25
  325. ' TempPlayerUp=Player
  326. ' PlayerUpRotator.enabled=true
  327. tilt=false
  328. state=true
  329. PlaySound "GameStart"
  330. players=1
  331. CanPlay1.state=1
  332. rst=0
  333. newgame.enabled=true
  334. else if state=true and players < maxplayers and Ballinplay=1 then
  335. if freeplay=0 then
  336. credit=credit-1
  337. if credit < 1 then
  338. DOF 137, DOFOff
  339. Lcredit.state=0
  340. end if
  341. credittxt.setvalue(credit)
  342. End if
  343. players=players+1
  344. CanPlay2.state=1
  345. CanPlay1.state=0
  346.  
  347. If B2SOn then
  348. if freeplay=0 then Controller.B2ssetCredits Credit
  349. Controller.B2ssetcanplay 31, players
  350. End If
  351. playsound "cluper"
  352. end if
  353. end if
  354. end if
  355.  
  356. If keycode = PlungerKey Then
  357. Plunger.PullBack
  358. PlaySoundAtVol "plungerpull", Plunger, 1
  359. End If
  360.  
  361. If keycode=LeftFlipperKey and State = false and OperatorMenu=0 then
  362. OperatorMenuTimer.Enabled = true
  363. end if
  364.  
  365. If keycode=LeftFlipperKey and State = false and OperatorMenu=1 then
  366. Options=Options+1
  367. If Options=5 then Options=1
  368. playsound "target"
  369. Select Case (Options)
  370. Case 1:
  371. Option1.visible=true
  372. Option4.visible=False
  373. Case 2:
  374. Option2.visible=true
  375. Option1.visible=False
  376. Case 3:
  377. Option3.visible=true
  378. Option2.visible=False
  379. Case 4:
  380. Option4.visible=true
  381. Option3.visible=False
  382. End Select
  383. end if
  384.  
  385. If keycode=RightFlipperKey and State = false and OperatorMenu=1 then
  386. PlaySound "metalhit2"
  387. Select Case (Options)
  388. Case 1:
  389. if Balls=3 then
  390. Balls=5
  391. if ebmode=0 then
  392. RepCard.image="ReplayCard5Balls"
  393. else
  394. RepCard.image="ReplayCard5BallsEB"
  395. end if
  396. else
  397. Balls=3
  398. if ebmode=0 then
  399. RepCard.image="ReplayCard3Balls"
  400. else
  401. RepCard.image="ReplayCard3BallsEB"
  402. end if
  403. end if
  404. OptionBalls.image = "OptionsBalls"&Balls
  405. Case 2:
  406. if freeplay=0 Then
  407. freeplay=1
  408. Else
  409. freeplay=0
  410. end if
  411. OptionFreeplay.image="OptionsFreeplay"&freeplay
  412. Case 3:
  413. if ebmode=0 then
  414. ebmode=1
  415. instcard.image="InstCardEB"
  416. OptionReplays.image="OptionReplays1"
  417. else
  418. ebmode=0
  419. instcard.image="InstCardReplay"
  420. OptionReplays.image="OptionReplays0"
  421. end if
  422. Case 4:
  423. OperatorMenu=0
  424. savehs
  425. HideOptions
  426. End Select
  427. End If
  428.  
  429. If HSEnterMode Then HighScoreProcessKey(keycode)
  430.  
  431. if tilt=false and state=true then
  432. If keycode = LeftFlipperKey Then
  433. LeftFlipper.RotateToEnd
  434. LgiLeftFlipper.state=1
  435. PlaySoundAtVol SoundFXDOF("fx_flipperup",101,DOFOn,DOFFlippers), LeftFlipper, 1
  436. PlaySoundAtVolLoops "Buzz", LeftFlipper, 0.01, -1
  437. End If
  438.  
  439. If keycode = RightFlipperKey Then
  440. RightFlipper.RotateToEnd
  441. LgiRightFlipper.state=1
  442. PlaySoundAtVol SoundFXDOF("fx_flipperup",102,DOFOn,DOFFlippers), RightFlipper, 1
  443. PlaySoundAtVolLoops "Buzz1", RightFlipper, 0.01, -1
  444. End If
  445.  
  446. If keycode = LeftTiltKey Then
  447. Nudge 90, 2
  448. checktilt
  449. End If
  450.  
  451. If keycode = RightTiltKey Then
  452. Nudge 270, 2
  453. checktilt
  454. End If
  455.  
  456. If keycode = CenterTiltKey Then
  457. Nudge 0, 2
  458. checktilt
  459. End If
  460.  
  461. If keycode = MechanicalTilt Then
  462. gametilted
  463. End If
  464.  
  465. end if
  466. End Sub
  467.  
  468. Sub OperatorMenuTimer_Timer
  469. OperatorMenu=1
  470. Displayoptions
  471. Options=1
  472. End Sub
  473.  
  474. Sub DisplayOptions
  475. OptionsBack.visible = true
  476. Option1.visible = True
  477. OptionBalls.visible = True
  478. OptionReplays.visible = True
  479. OptionFreeplay.visible = True
  480. End Sub
  481.  
  482. Sub HideOptions
  483. for each objekt In OptionMenu
  484. objekt.visible = false
  485. next
  486. End Sub
  487.  
  488.  
  489. Sub Darling_KeyUp(ByVal keycode)
  490.  
  491. if keycode = 203 then Cleft = 0' Left Arrow
  492.  
  493. if keycode = 200 then Cup = 0' Up Arrow
  494.  
  495. if keycode = 208 then Cdown = 0' Down Arrow
  496.  
  497. if keycode = 205 then Cright = 0' Right Arrow
  498.  
  499. If keycode = PlungerKey Then
  500. Plunger.Fire
  501. if ballhome.BallCntOver=1 then
  502. PlaySoundAt "plunger", Plunger 'PLAY WHEN BALL IS HIT
  503. else
  504. PlaySoundAt "plungerreleasefree", Plunger 'PLAY WHEN NO BALL TO PLUNGE
  505. end if
  506. End If
  507.  
  508. if keycode = LeftFlipperKey then
  509. OperatorMenuTimer.Enabled = false
  510. end if
  511.  
  512. If tilt=false and state=true then
  513. If keycode = LeftFlipperKey Then
  514. LeftFlipper.RotateToStart
  515. LgiLeftFlipper.duration 1, 100, 0
  516. PlaySoundAtVol SoundFXDOF("fx_flipperdown",101,DOFOff,DOFFlippers), LeftFlipper, 1
  517. StopSound "Buzz"
  518. End If
  519.  
  520. If keycode = RightFlipperKey Then
  521. RightFlipper.RotateToStart
  522. LgiRightFlipper.duration 1, 100, 0
  523. PlaySoundAtVol SoundFXDOF("fx_flipperdown",102,DOFOff,DOFFlippers), RightFlipper, 1
  524. StopSound "Buzz1"
  525. End If
  526. End if
  527. End Sub
  528.  
  529.  
  530. Dim Cup, Cdown, Cleft, Cright, contball, contballinplay, ControlBall, bcboost
  531. Dim bcvel, bcyveloffset, bcboostmulti
  532.  
  533. bcboost = 1 'Do Not Change - default setting
  534. bcvel = 4 'Controls the speed of the ball movement
  535. bcyveloffset = -0.01 'Offsets the force of gravity to keep the ball from drifting vertically on the table, should be negative
  536. bcboostmulti = 3 'Boost multiplier to ball veloctiy (toggled with the B key)
  537.  
  538. Sub BallControl_Timer()
  539. If Contball and ContBallInPlay then
  540. If Cright = 1 Then
  541. ControlBall.velx = bcvel*bcboost
  542. ElseIf Cleft = 1 Then
  543. ControlBall.velx = - bcvel*bcboost
  544. Else
  545. ControlBall.velx=0
  546. End If
  547. If Cup = 1 Then
  548. ControlBall.vely = -bcvel*bcboost
  549. ElseIf Cdown = 1 Then
  550. ControlBall.vely = bcvel*bcboost
  551. Else
  552. ControlBall.vely= bcyveloffset
  553. End If
  554. End If
  555. End Sub
  556.  
  557. sub flippertimer_timer()
  558. 'testbox.text=bonus
  559. 'testbox1.text=LeftBalls
  560. 'testbox2.text=RightBalls
  561. Pgate.rotx = Gate.currentangle*.6
  562. Pgate1.rotx = Gate1.currentangle*.6
  563. PgateRollUnder.roty=GateRollUnder.currentangle
  564.  
  565. if FlipperShadows=1 then
  566. FlipperLSh.RotZ = LeftFlipper.currentangle
  567. FlipperRSh.RotZ = RightFlipper.currentangle
  568. end if
  569.  
  570. end sub
  571.  
  572.  
  573. Sub PairedlampTimer_timer
  574. Lbonus20R.state = Lbonus20.state
  575. LDbonusR.state = LDbonus.state
  576. LspecialL1.state = LspecialL.state
  577. LspecialR1.state = LspecialR.state
  578. L300WL.state = LspecialL.state
  579. L300WLR.state = LspecialR.state
  580.  
  581. '********************track leftballs and RightBalls
  582.  
  583. select case (TGcaptiveL.BallCntOver+TGcaptiveL1.BallCntOver+TGcaptiveL2.BallCntOver)
  584. Case 0:
  585. LeftBalls=0
  586. RightBalls=5
  587. Case 1:
  588. select case (TGcaptiveR.BallCntOver+TGcaptiveR1.BallCntOver+TGcaptiveR2.BallCntOver)
  589. Case 2:
  590. LeftBalls=2
  591. RightBalls=3
  592. Case 3:
  593. LeftBalls=1
  594. RightBalls=4
  595. end Select
  596. case 2:
  597. LeftBalls=3
  598. RightBalls=2
  599. Case 3:
  600. select case (TGcaptiveR.BallCntOver)
  601. Case 0:
  602. LeftBalls=5
  603. RightBalls=0
  604. Case 1:
  605. LeftBalls=4
  606. RightBalls=1
  607. end Select
  608. end Select
  609.  
  610. end sub
  611.  
  612. sub coindelay_timer
  613. addcredit
  614. coindelay.enabled=false
  615. end sub
  616.  
  617. Sub addcredit
  618. if freeplay=0 then
  619. credit=credit+1
  620. DOF 137, DOFOn
  621. Lcredit.state=1
  622. if credit>25 then credit=25
  623. credittxt.setvalue(credit)
  624. If B2SOn Then Controller.B2ssetCredits Credit
  625. end if
  626. End sub
  627.  
  628. Sub Drain_Hit()
  629. DOF 134, DOFPulse
  630. PlaySoundAt "drain", Drain
  631. me.timerenabled=1
  632. End Sub
  633.  
  634. Sub Drain_timer
  635. scorebonus.enabled=true
  636. me.timerenabled=0
  637. End Sub
  638.  
  639. Sub BallHome_Hit() '******* for ball control script
  640. Set ControlBall = ActiveBall
  641. contballinplay = true
  642. End Sub
  643.  
  644. sub ballhome_unhit
  645. DOF 136, DOFPulse
  646. end sub
  647.  
  648. Sub EndControl_Hit() '******* for ball control script
  649. contballinplay = false
  650. End Sub
  651.  
  652. sub ballrel_hit
  653. lshootagain.state=0
  654. end sub
  655.  
  656. sub scorebonus_timer '************add bonus scoring if applicable
  657. if tilt=true then
  658. bonus=0
  659. Else
  660. if LDbonus.state=1 then
  661. dbonus=2
  662. else
  663. dbonus=1
  664. End if
  665. if bonus>0 then
  666. if bonus>1 or dbonus=2 then
  667. chimescount=2
  668. else
  669. chimescount=1
  670. end if
  671. chimestimer.interval=1
  672. chimestimer.enabled=true
  673. playsound "motor2", 0, 0.04
  674. me.enabled=False
  675. else
  676. bonus=0
  677. for each light in bonuslights: light.state=0: next
  678. end if
  679. end if
  680. if bonus=0 and chimestimer.enabled=0 then
  681. if lshootagain.state=lightstateon and tilt=false then
  682. newball
  683. ballreltimer.enabled=true
  684. else
  685. if players=1 or player=players then
  686. player=1
  687. Else
  688. player=player+1
  689. end if
  690. If B2SOn then Controller.B2ssetplayerup 30, player
  691. nextball
  692. end if
  693. me.enabled=false
  694. end if
  695. End sub
  696.  
  697. sub chimestimer_timer
  698. chimestimer.interval=100
  699. addpoints 1000
  700.  
  701. if (dbonus=2 and chimescount=1) or dbonus=1 then
  702. EVAL("Lbonus"&bonus).state=0
  703. bonus=bonus-1
  704. if bonus >0 then
  705. EVAL("Lbonus"&bonus).state=1
  706. if bonus=19 then Lbonus10.state=1
  707. end if
  708. end if
  709. chimescount = chimescount - 1
  710. if chimescount<1 then
  711. me.enabled=false
  712. ScoreBonus.enabled=True
  713. end if
  714. end Sub
  715.  
  716.  
  717. sub newgame_timer
  718. eg=0
  719. if LtopL.state=0 and LtopR.state=0 then LtopL.state=1
  720. ' for each light in GILights: light.state=1: next
  721. ldbonus.state=0
  722. Lshootagain.state=0
  723. tilttxt.text=" "
  724. gamov.text=" "
  725. for i=1 to 2
  726. EVAL("Bumper"&i).hashitevent = 1
  727. Next
  728.  
  729. If B2SOn then
  730. Controller.B2SSetGameOver 35,0
  731. Controller.B2SSetTilt 33,0
  732. Controller.B2ssetdata 1, 1
  733. if ebmode=0 then Controller.B2SSetMatch 34,0
  734. End If
  735. bipreel.setvalue 1
  736. if ebmode=0 then matchtxt.text=" "
  737. newball
  738. ballrelTimer.enabled=true
  739. newgame.enabled=false
  740. end sub
  741.  
  742.  
  743. sub newball
  744. if ballinplay=Balls then LDbonus.state=1
  745. bonus=0
  746. if LeftBalls>RightBalls then
  747. Lspecialr.state=1
  748. Lspeciall.state=0
  749. else
  750. Lspecialr.state=0
  751. Lspeciall.state=1
  752. end if
  753. End Sub
  754.  
  755.  
  756. sub nextball
  757. if tilt=true then
  758. for i=1 to 2
  759. EVAL("Bumper"&i).hashitevent = 1
  760. Next
  761. for each light in GILights: light.state=1: next
  762. for each light in BonusLights: light.state=0: next
  763. tilt=false
  764. tilttxt.text=" "
  765. If B2SOn then
  766. Controller.B2SSetTilt 33,0
  767. Controller.B2ssetdata 1, 1
  768. End If
  769. end if
  770. if player=1 then ballinplay=ballinplay+1
  771. if ballinplay>balls then
  772. playsound "motor2", 0, 0.04
  773. eg=1
  774. ballreltimer.enabled=true
  775. else
  776. For each objekt in PlayerHuds
  777. objekt.State = 0
  778. next
  779. For each objekt in PlayerHUDScores
  780. objekt.state=0
  781. next
  782. PlayerHuds(Player-1).State =1
  783. PlayerHUDScores(Player-1).state=1
  784. ' PlaySound("RotateThruPlayers"),0,.05,0,0.25
  785. ' TempPlayerUp=Player
  786. ' PlayerUpRotator.enabled=true
  787. if state=true then
  788. newball
  789. ballreltimer.enabled=true
  790. end if
  791. bipreel.setvalue ballinplay
  792. If B2SOn then Controller.B2ssetballinplay 32, Ballinplay
  793. end if
  794. End Sub
  795.  
  796. sub ballreltimer_timer
  797. dim hiscstate
  798. if eg=1 then
  799. hiscstate=0
  800. if ebmode=0 then matchnum
  801. state=false
  802. bipreel.setvalue 0
  803. gamov.text="GAME OVER"
  804. gamov.timerenabled=1
  805. tilttxt.timerenabled=1
  806. CanPlay1.state=0
  807. CanPlay2.state=0
  808. for i=1 to maxplayers
  809. if score(i)>hisc then
  810. hisc=score(i)
  811. hiscstate=1
  812. end if
  813. EVAL("Pup"&i).state=0
  814. EVAL("PupN"&i).state=0
  815. next
  816. if hiscstate=1 then
  817. HighScoreEntryInit()
  818. HStimer.uservalue = 0
  819. HStimer.enabled=1
  820. end if
  821. UpdatePostIt
  822. savehs
  823. If B2SOn then
  824. Controller.B2SSetGameOver 35,1
  825. Controller.B2ssetballinplay 32, 0
  826. Controller.B2SSetScorePlayer 5, hisc
  827. Controller.B2ssetcanplay 31, 0
  828. Controller.B2ssetcanplay 30, 0
  829. End If
  830. ballreltimer.enabled=false
  831. else
  832. Drain.kick 55,15,0
  833. ballreltimer.enabled=false
  834. PlaySoundAtVol SoundFXDOF("nextball",135,DOFPulse,DOFContactors), Drain, 1
  835. end if
  836. end sub
  837.  
  838. Sub HStimer_timer
  839. PlaySoundAtVol SoundFXDOF("knock",138,DOFPulse,DOFKnocker), BulbTop11, 1
  840. DOF 139,DOFPulse
  841. HStimer.uservalue=HStimer.uservalue+1
  842. if HStimer.uservalue=3 then me.enabled=0
  843. end sub
  844.  
  845. Sub PlayerUpRotator_timer()
  846. If RotatorTemp<maxplayers+1 then
  847. TempPlayerUp=TempPlayerUp+1
  848. If TempPlayerUp>maxplayers then
  849. TempPlayerUp=1
  850. end if
  851. For each objekt in PlayerHuds
  852. objekt.state = 0
  853. next
  854. For each objekt in PlayerHUDScores
  855. objekt.state=0
  856. next
  857. PlayerHuds(TempPlayerUp-1).State = 1
  858. PlayerHUDScores(TempPlayerUp-1).state=1
  859. If B2SOn Then Controller.B2SSetPlayerUp TempPlayerUp
  860. else
  861. if B2SOn then Controller.B2SSetPlayerUp Player
  862. PlayerUpRotator.enabled=false
  863. RotatorTemp=1
  864. For each objekt in PlayerHuds
  865. objekt.State = 0
  866. next
  867. For each objekt in PlayerHUDScores
  868. objekt.state=0
  869. next
  870. PlayerHuds(Player-1).State = 1
  871. PlayerHUDScores(Player-1).state=1
  872. end if
  873. RotatorTemp=RotatorTemp+1
  874. end sub
  875.  
  876. sub matchnum
  877. if matchnumb=0 then
  878. matchtxt.text="00"
  879. If B2SOn then Controller.B2SSetMatch 100
  880. else
  881. matchtxt.text=matchnumb*10
  882. If B2SOn then Controller.B2SSetMatch 34,Matchnumb*10
  883. end if
  884. For i=1 to players
  885. if (matchnumb*10)=(score(i) mod 100) then
  886. addcredit
  887. PlaySoundAtVol SoundFXDOF("knock",138,DOFPulse,DOFKnocker), BulbTop11, 1
  888. DOF 139,DOFPulse
  889. end if
  890. next
  891. end sub
  892.  
  893. '********** Bumpers
  894.  
  895.  
  896. Sub Bumper1_Hit
  897. if tilt=false then
  898. PlaySoundAtVol SoundFXDOF("fx_bumper4", 107, DOFPulse, DOFContactors), Bumper1, 1
  899. DOF 108,DOFPulse
  900. if bumperlight1.state=1 then
  901. addscore bumperlitscore
  902. else
  903. addscore bumperoffscore
  904. end if
  905. end if
  906. End Sub
  907.  
  908. Sub Bumper2_Hit
  909. if tilt=false then
  910. PlaySoundAtVol SoundFXDOF("fx_bumper4", 109, DOFPulse, DOFContactors), Bumper2, 1
  911. DOF 110,DOFPulse
  912. if BumperLight2.state=1 then
  913. addscore bumperlitscore
  914. else
  915. addscore bumperoffscore
  916. end if
  917. end if
  918. End Sub
  919.  
  920. Function SkirtAX(bumper, bumperball)
  921. skirtAX=cos(skirtA(bumper,bumperball))*(SkirtTilt) 'x component of angle
  922. if (bumper.y<bumperball.y) then skirtAX=skirtAX*-1 'adjust for ball hit bottom half
  923. End Function
  924.  
  925. Function SkirtAY(bumper, bumperball)
  926. skirtAY=sin(skirtA(bumper,bumperball))*(SkirtTilt) 'y component of angle
  927. if (bumper.x>bumperball.x) then skirtAY=skirtAY*-1 'adjust for ball hit left half
  928. End Function
  929.  
  930. Function SkirtA(bumper, bumperball)
  931. dim hitx, hity, dx, dy
  932. hitx=bumperball.x
  933. hity=bumperball.y
  934. dy=Abs(hity-bumper.y) 'y offset ball at hit to center of bumper
  935. if dy=0 then dy=0.0000001
  936. dx=Abs(hitx-bumper.x) 'x offset ball at hit to center of bumper
  937. skirtA=(atn(dx/dy)) '/(PI/180) 'angle in radians to ball from center of Bumper1
  938. End Function
  939.  
  940. '************** Kickers
  941.  
  942.  
  943. Sub Klsling_hit
  944. if L300WL.state=1 then
  945. addscore 300
  946. else
  947. addscore 30
  948. end if
  949. me.uservalue=1
  950. me.timerenabled=1
  951. End Sub
  952.  
  953. Sub Klsling_timer
  954. select case me.uservalue
  955. case 4:
  956. PlaySoundAtVol SoundFXDOF("holekick",103,DOFPulse,DOFContactors), Klsling, 1
  957. DOF 139, DOFPulse
  958. me.kick 23.3,37
  959. PkickarmL.rotx=20
  960. case 6:
  961. PkickarmL.rotx=0
  962. me.timerenabled=0
  963. end Select
  964. me.uservalue=me.uservalue+1
  965. End Sub
  966.  
  967. Sub Krsling_hit
  968. if L300WLR.state=1 then
  969. addscore 300
  970. else
  971. addscore 30
  972. end if
  973. me.uservalue=1
  974. me.timerenabled=1
  975. End Sub
  976.  
  977. Sub Krsling_timer
  978. select case me.uservalue
  979. case 4:
  980. PlaySoundAtVol SoundFXDOF("holekick",105,DOFPulse,DOFContactors), Krsling, 1
  981. DOF 139, DOFPulse
  982. me.kick -23.3,37
  983. PkickarmR.rotx=20
  984. case 6:
  985. PkickarmR.rotx=0
  986. me.timerenabled=0
  987. end Select
  988. me.uservalue=me.uservalue+1
  989. End Sub
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998. '********** Dingwalls - animated - timer 50
  999.  
  1000. sub dingwalla_hit
  1001. if state=true and tilt=false then addscore 50
  1002. SlingA.visible=0
  1003. SlingA1.visible=1
  1004. me.uservalue=1
  1005. Me.timerenabled=1
  1006. end sub
  1007.  
  1008. sub dingwalla_timer 'default 50 timer
  1009. select case me.uservalue
  1010. Case 1: SlingA1.visible=0: SlingA.visible=1
  1011. case 2: SlingA.visible=0: SlingA2.visible=1
  1012. Case 3: SlingA2.visible=0: SlingA.visible=1: Me.timerenabled=0
  1013. end Select
  1014. me.uservalue=me.uservalue+1
  1015. end sub
  1016.  
  1017.  
  1018. sub dingwallb_hit
  1019. if state=true and tilt=false then addscore 50
  1020. SlingB.visible=0
  1021. SlingB1.visible=1
  1022. me.uservalue=1
  1023. Me.timerenabled=1
  1024. end sub
  1025.  
  1026. sub dingwallb_timer 'default 50 timer
  1027. select case me.uservalue
  1028. Case 1: Slingb1.visible=0: SlingB.visible=1
  1029. case 2: SlingB.visible=0: Slingb2.visible=1
  1030. Case 3: Slingb2.visible=0: SlingB.visible=1: Me.timerenabled=0
  1031. end Select
  1032. me.uservalue=me.uservalue+1
  1033. end sub
  1034.  
  1035. sub dingwallc_hit
  1036. if state=true and tilt=false then addscore 10
  1037. SlingC.visible=0
  1038. SlingC1.visible=1
  1039. me.uservalue=1
  1040. Me.timerenabled=1
  1041. end sub
  1042.  
  1043. sub dingwallc_timer 'default 50 timer
  1044. select case me.uservalue
  1045. Case 1: SlingC1.visible=0: SlingC.visible=1
  1046. case 2: SlingC.visible=0: SlingC2.visible=1
  1047. Case 3: SlingC2.visible=0: SlingC.visible=1: Me.timerenabled=0
  1048. end Select
  1049. me.uservalue=me.uservalue+1
  1050. end sub
  1051.  
  1052. sub dingwalld_hit
  1053. if state=true and tilt=false then addscore 10
  1054. SlingD.visible=0
  1055. SlingD1.visible=1
  1056. me.uservalue=1
  1057. Me.timerenabled=1
  1058. end sub
  1059.  
  1060. sub dingwalld_timer 'default 50 timer
  1061. select case me.uservalue
  1062. Case 1: SlingD1.visible=0: SlingD.visible=1
  1063. case 2: SlingD.visible=0: SlingD2.visible=1
  1064. Case 3: SlingD2.visible=0: SlingD.visible=1: Me.timerenabled=0
  1065. end Select
  1066. me.uservalue=me.uservalue+1
  1067. end sub
  1068.  
  1069. sub dingwalle_hit
  1070. if state=true and tilt=false then addscore 50
  1071. SlingE.visible=0
  1072. SlingE1.visible=1
  1073. me.uservalue=1
  1074. Me.timerenabled=1
  1075. end sub
  1076.  
  1077. sub dingwalle_timer 'default 50 timer
  1078. select case me.uservalue
  1079. Case 1: SlingE1.visible=0: SlingE.visible=1
  1080. case 2: SlingE.visible=0: SlingE2.visible=1
  1081. Case 3: SlingE2.visible=0: SlingE.visible=1: Me.timerenabled=0
  1082. end Select
  1083. me.uservalue=me.uservalue+1
  1084. end sub
  1085.  
  1086. sub dingwallf_hit
  1087. if state=true and tilt=false then addscore 50
  1088. SlingF.visible=0
  1089. SlingF1.visible=1
  1090. me.uservalue=1
  1091. Me.timerenabled=1
  1092. end sub
  1093.  
  1094. sub dingwallf_timer 'default 50 timer
  1095. select case me.uservalue
  1096. Case 1: SlingF1.visible=0: SlingF.visible=1
  1097. case 2: SlingF.visible=0: SlingF2.visible=1
  1098. Case 3: SlingF2.visible=0: SlingF.visible=1: Me.timerenabled=0
  1099. end Select
  1100. me.uservalue=me.uservalue+1
  1101. end sub
  1102.  
  1103. sub dingwallg_hit
  1104. SlingG.visible=0
  1105. SlingG1.visible=1
  1106. me.uservalue=1
  1107. Me.timerenabled=1
  1108. end sub
  1109.  
  1110. sub dingwallg_timer 'default 50 timer
  1111. select case me.uservalue
  1112. Case 1: SlingG1.visible=0: SlingG.visible=1
  1113. case 2: SlingG.visible=0: SlingG2.visible=1
  1114. Case 3: SlingG2.visible=0: SlingG.visible=1: Me.timerenabled=0
  1115. end Select
  1116. me.uservalue=me.uservalue+1
  1117. end sub
  1118.  
  1119. sub dingwallh_hit
  1120. SlingH.visible=0
  1121. SlingH1.visible=1
  1122. me.uservalue=1
  1123. Me.timerenabled=1
  1124. end sub
  1125.  
  1126. sub dingwallh_timer 'default 50 timer
  1127. select case me.uservalue
  1128. Case 1: SlingH1.visible=0: SlingH.visible=1
  1129. case 2: SlingH.visible=0: SlingH2.visible=1
  1130. Case 3: SlingH2.visible=0: SlingH.visible=1: Me.timerenabled=0
  1131. end Select
  1132. me.uservalue=me.uservalue+1
  1133. end sub
  1134.  
  1135. '********** Triggers
  1136.  
  1137. sub TGoutL_hit
  1138. DOF 113, DOFPulse
  1139. addbonus
  1140. end sub
  1141.  
  1142. sub TGoutR_hit
  1143. DOF 114, DOFPulse
  1144. addbonus
  1145. end sub
  1146.  
  1147. sub TGbuttonL_hit
  1148. addbonus
  1149. end sub
  1150.  
  1151. sub TGbuttonR_hit
  1152. addbonus
  1153. end sub
  1154.  
  1155. sub TGtopL_hit '***** top L rollover
  1156. DOF 111, DOFPulse
  1157. if LtopL.state=1 then
  1158. addbonus
  1159. me.uservalue=1
  1160. me.timerenabled=1
  1161. else
  1162. addbonus
  1163. end if
  1164. end sub
  1165.  
  1166. sub TGtopL_timer
  1167. addbonus
  1168. me.uservalue=me.uservalue+1
  1169. if me.uservalue=extraadvance then me.timerenabled=0
  1170. end sub
  1171.  
  1172. sub TGtopR_hit '***** top R rollover
  1173. DOF 112, DOFPulse
  1174. if LtopR.state=1 then
  1175. addbonus
  1176. me.uservalue=1
  1177. me.timerenabled=1
  1178. else
  1179. addbonus
  1180. end if
  1181. end sub
  1182.  
  1183. sub TGtopR_timer
  1184. addbonus
  1185. me.uservalue=me.uservalue+1
  1186. if me.uservalue=extraadvance then me.timerenabled=0
  1187. end sub
  1188.  
  1189. sub TGcaptiveL3_hit
  1190. if not tilt then
  1191. if TGcaptiveR3.timerenabled then addbonus
  1192. me.timerenabled=1
  1193. if LspecialL.state=1 and (TGcaptiveL.ballcntover+TGcaptiveL1.ballcntover+TGcaptiveL2.ballcntover=3) then awardspecial
  1194. end if
  1195. end sub
  1196.  
  1197. sub TGcaptiveL3_timer
  1198. me.timerenabled=0
  1199. end sub
  1200.  
  1201. sub TGcaptiveR3_hit
  1202. if not tilt then
  1203. if TGcaptiveL3.timerenabled then addbonus
  1204. me.timerenabled=1
  1205. if LspecialR.state=1 and (TGcaptiveR.ballcntover+TGcaptiveR1.ballcntover+TGcaptiveR2.ballcntover=3) then awardspecial
  1206. end if
  1207. end sub
  1208.  
  1209. sub TGcaptiveR3_timer
  1210. me.timerenabled=0
  1211. end sub
  1212.  
  1213. sub awardspecial
  1214. LShootAgain.state=1
  1215. if lspecialL.state=1 then
  1216. lspeciall.state=0
  1217. lspecialr.state=1
  1218. else
  1219. lspeciall.state=1
  1220. lspecialr.state=0
  1221. end if
  1222. end sub
  1223.  
  1224. '********************* Gates
  1225.  
  1226. sub GateRollUnder_hit
  1227. addbonus
  1228. end sub
  1229.  
  1230.  
  1231. '********** Scoring
  1232.  
  1233. sub addbonus
  1234. bonus=bonus+1
  1235. if bonus>20 then bonus=20
  1236. EVAL("Lbonus"&bonus).state=1
  1237. if bonus>1 then EVAL("Lbonus"&(bonus-1)).state=0
  1238. if bonus=11 then Lbonus10.state=1
  1239. if bonus=20 then Lbonus10.state=0
  1240. addscore 100
  1241. end sub
  1242.  
  1243. sub addscore(points)
  1244. if tilt=false and state=true then
  1245. If points = 10 then
  1246. matchnumb=matchnumb+1
  1247. if matchnumb>9 then matchnumb=0
  1248. end if
  1249. if points=10 or points=100 or points=1000 then
  1250. addpoints Points
  1251. else
  1252. If Points < 100 and AddScore10Timer.enabled = false Then
  1253. Add10 = Points \ 10
  1254. AddScore10Timer.Enabled = TRUE
  1255. ElseIf Points < 1000 and AddScore100Timer.enabled = false Then
  1256. Add100 = Points \ 100
  1257. AddScore100Timer.Enabled = TRUE
  1258. ElseIf AddScore1000Timer.enabled = false Then
  1259. Add1000 = Points \ 1000
  1260. AddScore1000Timer.Enabled = TRUE
  1261. End If
  1262. End If
  1263. end if
  1264. End Sub
  1265.  
  1266. Sub AddScore10Timer_Timer()
  1267. if Add10 > 0 then
  1268. AddPoints 10
  1269. Add10 = Add10 - 1
  1270. Else
  1271. Me.Enabled = FALSE
  1272. End If
  1273. End Sub
  1274.  
  1275. Sub AddScore100Timer_Timer()
  1276. if Add100 > 0 then
  1277. AddPoints 100
  1278. Add100 = Add100 - 1
  1279. Else
  1280. Me.Enabled = FALSE
  1281. End If
  1282. End Sub
  1283.  
  1284. Sub AddScore1000Timer_Timer()
  1285. if Add1000 > 0 then
  1286. AddPoints 1000
  1287. Add1000 = Add1000 - 1
  1288. Else
  1289. Me.Enabled = FALSE
  1290. End If
  1291. End Sub
  1292.  
  1293. Sub AddPoints(Points)
  1294. score(player)=score(player)+points
  1295. EVAL("ScoreReel"&player).addvalue(points)
  1296. If B2SOn Then Controller.B2SSetScorePlayer player, score(player) MOD 100000
  1297.  
  1298. ' Sounds: there are 3 sounds: tens, hundreds and thousands
  1299. If Points = 100 AND(Score(player) MOD 1000) \ 100 = 0 Then 'New 1000 reel
  1300. PlaySoundAtVol SoundFXDOF("bell1000",143,DOFPulse,DOFChimes), chimesound, 1
  1301. ElseIf Points = 10 AND(Score(player) MOD 100) \ 10 = 0 Then 'New 100 reel
  1302. if LtopL.state=1 then
  1303. LtopL.state=0
  1304. LtopR.state=1
  1305. else
  1306. LtopL.state=1
  1307. LtopR.state=0
  1308. end if
  1309. PlaySoundAtVol SoundFXDOF("bell100",142,DOFPulse,DOFChimes), chimesound, 1
  1310. ElseIf points = 1000 Then
  1311. PlaySoundAtVol SoundFXDOF("bell1000",143,DOFPulse,DOFChimes), chimesound, 1
  1312. elseif Points = 100 Then
  1313. PlaySoundAtVol SoundFXDOF("bell100",142,DOFPulse,DOFChimes), chimesound, 1
  1314. Else
  1315. if LtopL.state=1 then
  1316. LtopL.state=0
  1317. LtopR.state=1
  1318. else
  1319. LtopL.state=1
  1320. LtopR.state=0
  1321. end if
  1322. PlaySoundAtVol SoundFXDOF("bell10",141,DOFPulse,DOFChimes), chimesound, 1
  1323. End If
  1324. checkreplays
  1325. End Sub
  1326.  
  1327. Sub checkreplays
  1328. ' check replays and rollover
  1329. if score(player)=>99999 then
  1330. If B2SOn then Controller.B2SSetScoreRollover 24 + player, 1
  1331. EVAL("Reel100K"&player).setvalue(int(score(player)/100000))
  1332. End if
  1333. if score(player)=>replay1 and rep(player)=0 then
  1334. if ebmode=0 then
  1335. addcredit
  1336. else
  1337. lshootagain.state=1
  1338. end if
  1339. rep(player)=1
  1340. PlaySoundAtVol SoundFXDOF("knock",138,DOFPulse,DOFKnocker), BulbTop11, 1
  1341. DOF 139, DOFPulse
  1342. end if
  1343. if score(player)=>replay2 and rep(player)=1 then
  1344. if ebmode=0 then
  1345. addcredit
  1346. else
  1347. lshootagain.state=1
  1348. end if
  1349. rep(player)=2
  1350. PlaySoundAtVol SoundFXDOF("knock",138,DOFPulse,DOFKnocker), BulbTop11, 1
  1351. DOF 139, DOFPulse
  1352. end if
  1353. if score(player)=>replay3 and rep(player)=2 then
  1354. if ebmode=0 then
  1355. addcredit
  1356. else
  1357. lshootagain.state=1
  1358. end if
  1359. rep(player)=3
  1360. PlaySoundAtVol SoundFXDOF("knock",138,DOFPulse,DOFKnocker), BulbTop11, 1
  1361. DOF 139, DOFPulse
  1362. end if
  1363. end sub
  1364.  
  1365.  
  1366. Sub CheckTilt
  1367. If Tilttimer.Enabled = True Then
  1368. TiltSens = TiltSens + 1
  1369. if TiltSens = 3 Then GameTilted
  1370. Else
  1371. TiltSens = 0
  1372. Tilttimer.Enabled = True
  1373. End If
  1374. End Sub
  1375.  
  1376. Sub Tilttimer_Timer()
  1377. Tilttimer.Enabled = False
  1378. End Sub
  1379.  
  1380. Sub GameTilted
  1381. Tilt = True
  1382. tilttxt.text="TILT"
  1383. If B2SOn Then Controller.B2SSetTilt 33,1
  1384. If B2SOn Then Controller.B2ssetdata 1, 0
  1385. turnoff
  1386. End Sub
  1387.  
  1388. sub turnoff
  1389. for i=1 to 2
  1390. EVAL("Bumper"&i).hashitevent = 0
  1391. Next
  1392. for each light in GILights: light.state=0: next
  1393. LeftFlipper.RotateToStart
  1394. LgiLeftFlipper.duration 1, 100, 0
  1395. StopSound "Buzz"
  1396. DOF 101, DOFOff
  1397. RightFlipper.RotateToStart
  1398. LgiRightFlipper.duration 1, 100, 0
  1399. StopSound "Buzz1"
  1400. DOF 102, DOFOff
  1401. end sub
  1402.  
  1403. '*********************************************************************
  1404. ' Positional Sound Playback Functions
  1405. '*********************************************************************
  1406.  
  1407. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  1408. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  1409. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  1410. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  1411. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  1412. End Sub
  1413.  
  1414. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  1415. Sub PlaySoundAt(soundname, tableobj)
  1416. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  1417. End Sub
  1418.  
  1419. Sub PlaySoundAtBall(soundname)
  1420. PlaySoundAt soundname, ActiveBall
  1421. End Sub
  1422.  
  1423. '**************************************************************************
  1424. ' Additional Positional Sound Playback Functions by DJRobX
  1425. '**************************************************************************
  1426.  
  1427. Sub PlaySoundAtVol(sound, tableobj, Vol)
  1428. PlaySound sound, 1, Vol, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  1429. End Sub
  1430.  
  1431. 'Set position at table object, vol, and loops manually.
  1432.  
  1433. Sub PlaySoundAtVolLoops(sound, tableobj, Vol, Loops)
  1434. PlaySound sound, Loops, Vol, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  1435. End Sub
  1436.  
  1437. '*********************************************************************
  1438. ' Supporting Ball & Sound Functions
  1439. '*********************************************************************
  1440.  
  1441. Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
  1442. Dim tmp
  1443. tmp = tableobj.y * 2 / Darling.height-1
  1444. If tmp > 0 Then
  1445. AudioFade = Csng(tmp ^10)
  1446. Else
  1447. AudioFade = Csng(-((- tmp) ^10) )
  1448. End If
  1449. End Function
  1450.  
  1451. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  1452. Dim tmp
  1453. tmp = tableobj.x * 2 / Darling.width-1
  1454. If tmp > 0 Then
  1455. AudioPan = Csng(tmp ^10)
  1456. Else
  1457. AudioPan = Csng(-((- tmp) ^10) )
  1458. End If
  1459. End Function
  1460.  
  1461. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1462. Vol = Csng(BallVel(ball) ^2 / 2000)
  1463. End Function
  1464.  
  1465. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1466. Pitch = BallVel(ball) * 20
  1467. End Function
  1468.  
  1469. Function BallVel(ball) 'Calculates the ball speed
  1470. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1471. End Function
  1472.  
  1473. '*****************************************
  1474. ' JP's VP10 Rolling Sounds
  1475. '*****************************************
  1476.  
  1477. Const tnob = 7 ' total number of balls
  1478. ReDim rolling(tnob)
  1479. InitRolling
  1480.  
  1481. Sub InitRolling
  1482. Dim i
  1483. For i = 0 to tnob
  1484. rolling(i) = False
  1485. Next
  1486. End Sub
  1487.  
  1488. Sub RollingTimer_Timer()
  1489. Dim BOT, b
  1490. BOT = GetBalls
  1491.  
  1492. ' stop the sound of deleted balls
  1493. For b = UBound(BOT) + 1 to tnob
  1494. rolling(b) = False
  1495. StopSound("fx_ballrolling" & b)
  1496. Next
  1497.  
  1498. ' exit the sub if no balls on the table
  1499. If UBound(BOT) = -1 Then Exit Sub
  1500.  
  1501. ' play the rolling sound for each ball
  1502. For b = 0 to UBound(BOT)
  1503. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1504. rolling(b) = True
  1505. PlaySound("fx_ballrolling" & b), -1, (Vol(BOT(b))/2), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  1506. Else
  1507. If rolling(b) = True Then
  1508. StopSound("fx_ballrolling" & b)
  1509. rolling(b) = False
  1510. End If
  1511. End If
  1512. Next
  1513. End Sub
  1514.  
  1515. '**********************
  1516. ' Ball Collision Sound
  1517. '**********************
  1518.  
  1519. Sub OnBallBallCollision(ball1, ball2, velocity)
  1520. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  1521. End Sub
  1522.  
  1523.  
  1524. '*****************************************
  1525. ' BALL SHADOW
  1526. '*****************************************
  1527. Dim BallShadow
  1528. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5,BallShadow6,BallShadow7)
  1529.  
  1530. Sub BallShadowUpdate_timer()
  1531. Dim BOT, b
  1532. Dim maxXoffset
  1533. maxXoffset=6
  1534. BOT = GetBalls
  1535. ' exit the Sub if no balls on the table
  1536. If UBound(BOT) <1 Then Exit Sub
  1537. ' render the shadow for each ball
  1538. For b = 0 to UBound(BOT)
  1539. BallShadow(b).X = BOT(b).X-maxXoffset*(1-(Bot(1).X)/(Darling.Width/2))
  1540. BallShadow(b).Y = BOT(b).Y + 12
  1541. If BOT(b).Z > 0 and BOT(b).Z < 30 Then
  1542. BallShadow(b).visible = 1
  1543. Else
  1544. BallShadow(b).visible = 0
  1545. End If
  1546. Next
  1547. End Sub
  1548.  
  1549.  
  1550.  
  1551. '************************************
  1552. ' What you need to add to your table
  1553. '************************************
  1554.  
  1555. ' a timer called RollingTimer. With a fast interval, like 10
  1556. ' one collision sound, in this script is called fx_collide
  1557. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  1558. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  1559.  
  1560.  
  1561. '******************************************
  1562. ' Explanation of the rolling sound routine
  1563. '******************************************
  1564.  
  1565. ' sounds are played based on the ball speed and position
  1566.  
  1567. ' the routine checks first for deleted balls and stops the rolling sound.
  1568.  
  1569. ' The For loop goes through all the balls on the table and checks for the ball speed and
  1570. ' if the ball is on the table (height lower than 30) then then it plays the sound
  1571. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  1572.  
  1573. ' The sound is played using the VOL, PAN and PITCH functions, so the volume and pitch of the sound
  1574. ' will change according to the ball speed, and the PAN function will change the stereo position according
  1575. ' to the position of the ball on the table.
  1576.  
  1577.  
  1578. '**************************************
  1579. ' Explanation of the collision routine
  1580. '**************************************
  1581.  
  1582. ' The collision is built in VP.
  1583. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  1584. ' 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
  1585. ' depending of the speed of the collision.
  1586.  
  1587.  
  1588. Sub a_Triggers_Hit (idx)
  1589. playsound "sensor", 0,1,AudioPan(ActiveBall),0,0,0,1,AudioFade(ActiveBall)
  1590. End sub
  1591.  
  1592. Sub a_Pins_Hit (idx)
  1593. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  1594. End Sub
  1595.  
  1596. Sub a_Targets_Hit (idx)
  1597. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  1598. End Sub
  1599.  
  1600. Sub a_DropTargets_Hit (idx)
  1601. PlaySound "DTDrop", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  1602. End Sub
  1603.  
  1604. Sub a_Metals_Thin_Hit (idx)
  1605. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1606. End Sub
  1607.  
  1608. Sub a_Metals_Medium_Hit (idx)
  1609. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1610. End Sub
  1611.  
  1612. Sub a_Metals2_Hit (idx)
  1613. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1614. End Sub
  1615.  
  1616. Sub a_Gates_Hit (idx)
  1617. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1618. End Sub
  1619.  
  1620. Sub Spinner_Spin
  1621. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  1622. End Sub
  1623.  
  1624. Sub a_Rubbers_Hit(idx)
  1625. dim finalspeed
  1626. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1627. If finalspeed > 20 then
  1628. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1629. End if
  1630. If finalspeed >= 6 AND finalspeed <= 20 then
  1631. RandomSoundRubber()
  1632. End If
  1633. End Sub
  1634.  
  1635. Sub a_Posts_Hit(idx)
  1636. dim finalspeed
  1637. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1638. If finalspeed > 16 then
  1639. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1640. End if
  1641. If finalspeed >= 6 AND finalspeed <= 16 then
  1642. RandomSoundRubber()
  1643. End If
  1644. End Sub
  1645.  
  1646. Sub RandomSoundRubber()
  1647. Select Case Int(Rnd*3)+1
  1648. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall)*2, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1649. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall)*2, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1650. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall)*2, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1651. End Select
  1652. End Sub
  1653.  
  1654. Sub LeftFlipper_Collide(parm)
  1655. RandomSoundFlipper()
  1656. End Sub
  1657.  
  1658.  
  1659. Sub RightFlipper_Collide(parm)
  1660. RandomSoundFlipper()
  1661. End Sub
  1662.  
  1663. Sub RandomSoundFlipper()
  1664. Select Case Int(Rnd*3)+1
  1665. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall)*2, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1666. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall)*2, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1667. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall)*2, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1668. End Select
  1669. End Sub
  1670.  
  1671.  
  1672. sub savehs
  1673. savevalue "Darling", "credit", credit
  1674. savevalue "Darling", "hiscore", hisc
  1675. savevalue "Darling", "match", matchnumb
  1676. savevalue "Darling", "score1", score(1)
  1677. savevalue "Darling", "score2", score(2)
  1678. savevalue "Darling", "score3", score(3)
  1679. savevalue "Darling", "score4", score(4)
  1680. savevalue "Darling", "balls", balls
  1681. savevalue "Darling", "leftballs", leftballs
  1682. savevalue "Darling", "rightballs", rightballs
  1683. savevalue "Darling", "hsa1", HSA1
  1684. savevalue "Darling", "hsa2", HSA2
  1685. savevalue "Darling", "hsa3", HSA3
  1686. savevalue "Darling", "freeplay", freeplay
  1687. savevalue "Darling", "ebmode", ebmode
  1688. end sub
  1689.  
  1690. sub loadhs
  1691. dim temp
  1692. temp = LoadValue("Darling", "credit")
  1693. If (temp <> "") then credit = CDbl(temp)
  1694. temp = LoadValue("Darling", "hiscore")
  1695. If (temp <> "") then hisc = CDbl(temp)
  1696. temp = LoadValue("Darling", "match")
  1697. If (temp <> "") then matchnumb = CDbl(temp)
  1698. temp = LoadValue("Darling", "score1")
  1699. If (temp <> "") then score(1) = CDbl(temp)
  1700. temp = LoadValue("Darling", "score2")
  1701. If (temp <> "") then score(2) = CDbl(temp)
  1702. temp = LoadValue("Darling", "score3")
  1703. If (temp <> "") then score(3) = CDbl(temp)
  1704. temp = LoadValue("Darling", "score4")
  1705. If (temp <> "") then score(4) = CDbl(temp)
  1706. temp = LoadValue("Darling", "balls")
  1707. If (temp <> "") then balls = CDbl(temp)
  1708. temp = LoadValue("Darling", "leftballs")
  1709. If (temp <> "") then leftballs = CDbl(temp)
  1710. temp = LoadValue("Darling", "rightballs")
  1711. If (temp <> "") then rightballs = CDbl(temp)
  1712. temp = LoadValue("Darling", "hsa1")
  1713. If (temp <> "") then HSA1 = CDbl(temp)
  1714. temp = LoadValue("Darling", "hsa2")
  1715. If (temp <> "") then HSA2 = CDbl(temp)
  1716. temp = LoadValue("Darling", "hsa3")
  1717. If (temp <> "") then HSA3 = CDbl(temp)
  1718. temp = LoadValue("Darling", "freeplay")
  1719. If (temp <> "") then freeplay = CDbl(temp)
  1720. temp = LoadValue("Darling", "ebmode")
  1721. If (temp <> "") then ebmode = CDbl(temp)
  1722. end sub
  1723.  
  1724. Sub Darling_Exit()
  1725. Savehs
  1726. turnoff
  1727. If B2SOn Then Controller.stop
  1728. End Sub
  1729.  
  1730. '==========================================================================================================================================
  1731. '============================================================= START OF HIGH SCORES ROUTINES =============================================================
  1732. '==========================================================================================================================================
  1733. '
  1734. 'ADD LINE TO TABLE_KEYDOWN SUB WITH THE FOLLOWING: If HSEnterMode Then HighScoreProcessKey(keycode) AFTER THE STARTGAME ENTRY
  1735. 'ADD: And Not HSEnterMode=true TO IF KEYCODE=STARTGAMEKEY
  1736. 'TO SHOW THE SCORE ON POST-IT ADD LINE AT RELEVENT LOCATION THAT HAS: UpdatePostIt
  1737. 'TO INITIATE ADDING INITIALS ADD LINE AT RELEVENT LOCATION THAT HAS: HighScoreEntryInit()
  1738. 'ADD THE FOLLOWING LINES TO TABLE_INIT TO SETUP POSTIT
  1739. ' if HSA1="" then HSA1=25
  1740. ' if HSA2="" then HSA2=25
  1741. ' if HSA3="" then HSA3=25
  1742. ' UpdatePostIt
  1743. 'ADD HSA1, HSA2 AND HSA3 TO SAVE AND LOAD VALUES FOR TABLE
  1744. 'ADD A TIMER NAMED HighScoreFlashTimer WITH INTERVAL 100 TO TABLE
  1745. 'SET HSSSCOREX BELOW TO WHATEVER VARIABLE YOU USE FOR HIGH SCORE.
  1746. 'ADD OBJECTS TO PLAYFIELD (EASIEST TO JUST COPY FROM THIS TABLE)
  1747. 'IMPORT POST-IT IMAGES
  1748.  
  1749.  
  1750. Dim HSA1, HSA2, HSA3
  1751. Dim HSEnterMode, hsLetterFlash, hsEnteredDigits(3), hsCurrentDigit, hsCurrentLetter
  1752. Dim HSArray
  1753. Dim HSScoreM,HSScore100k, HSScore10k, HSScoreK, HSScore100, HSScore10, HSScore1, HSScorex 'Define 6 different score values for each reel to use
  1754. HSArray = Array("Postit0","postit1","postit2","postit3","postit4","postit5","postit6","postit7","postit8","postit9","postitBL","postitCM","Tape")
  1755. Const hsFlashDelay = 4
  1756.  
  1757. ' ***********************************************************
  1758. ' HiScore DISPLAY
  1759. ' ***********************************************************
  1760.  
  1761. Sub UpdatePostIt
  1762. dim tempscore
  1763. HSScorex = hisc
  1764. TempScore = HSScorex
  1765. HSScore1 = 0
  1766. HSScore10 = 0
  1767. HSScore100 = 0
  1768. HSScoreK = 0
  1769. HSScore10k = 0
  1770. HSScore100k = 0
  1771. HSScoreM = 0
  1772. if len(TempScore) > 0 Then
  1773. HSScore1 = cint(right(Tempscore,1))
  1774. end If
  1775. if len(TempScore) > 1 Then
  1776. TempScore = Left(TempScore,len(TempScore)-1)
  1777. HSScore10 = cint(right(Tempscore,1))
  1778. end If
  1779. if len(TempScore) > 1 Then
  1780. TempScore = Left(TempScore,len(TempScore)-1)
  1781. HSScore100 = cint(right(Tempscore,1))
  1782. end If
  1783. if len(TempScore) > 1 Then
  1784. TempScore = Left(TempScore,len(TempScore)-1)
  1785. HSScoreK = cint(right(Tempscore,1))
  1786. end If
  1787. if len(TempScore) > 1 Then
  1788. TempScore = Left(TempScore,len(TempScore)-1)
  1789. HSScore10k = cint(right(Tempscore,1))
  1790. end If
  1791. if len(TempScore) > 1 Then
  1792. TempScore = Left(TempScore,len(TempScore)-1)
  1793. HSScore100k = cint(right(Tempscore,1))
  1794. end If
  1795. if len(TempScore) > 1 Then
  1796. TempScore = Left(TempScore,len(TempScore)-1)
  1797. HSScoreM = cint(right(Tempscore,1))
  1798. end If
  1799. Pscore6.image = HSArray(HSScoreM):If HSScorex<1000000 Then PScore6.image = HSArray(10)
  1800. Pscore5.image = HSArray(HSScore100K):If HSScorex<100000 Then PScore5.image = HSArray(10)
  1801. PScore4.image = HSArray(HSScore10K):If HSScorex<10000 Then PScore4.image = HSArray(10)
  1802. PScore3.image = HSArray(HSScoreK):If HSScorex<1000 Then PScore3.image = HSArray(10)
  1803. PScore2.image = HSArray(HSScore100):If HSScorex<100 Then PScore2.image = HSArray(10)
  1804. PScore1.image = HSArray(HSScore10):If HSScorex<10 Then PScore1.image = HSArray(10)
  1805. PScore0.image = HSArray(HSScore1):If HSScorex<1 Then PScore0.image = HSArray(10)
  1806. if HSScorex<1000 then
  1807. PComma.image = HSArray(10)
  1808. else
  1809. PComma.image = HSArray(11)
  1810. end if
  1811. if HSScorex<1000000 then
  1812. PComma2.image = HSArray(10)
  1813. else
  1814. PComma2.image = HSArray(11)
  1815. end if
  1816. ' if showhisc=1 and showhiscnames=1 then
  1817. ' for each objekt in hiscname:objekt.visible=1:next
  1818. HSName1.image = ImgFromCode(HSA1, 1)
  1819. HSName2.image = ImgFromCode(HSA2, 2)
  1820. HSName3.image = ImgFromCode(HSA3, 3)
  1821. ' else
  1822. ' for each objekt in hiscname:objekt.visible=0:next
  1823. ' end if
  1824. End Sub
  1825.  
  1826. Function ImgFromCode(code, digit)
  1827. Dim Image
  1828. if (HighScoreFlashTimer.Enabled = True and hsLetterFlash = 1 and digit = hsCurrentLetter) then
  1829. Image = "postitBL"
  1830. elseif (code + ASC("A") - 1) >= ASC("A") and (code + ASC("A") - 1) <= ASC("Z") then
  1831. Image = "postit" & chr(code + ASC("A") - 1)
  1832. elseif code = 27 Then
  1833. Image = "PostitLT"
  1834. elseif code = 0 Then
  1835. image = "PostitSP"
  1836. Else
  1837. msgbox("Unknown display code: " & code)
  1838. end if
  1839. ImgFromCode = Image
  1840. End Function
  1841.  
  1842. Sub HighScoreEntryInit()
  1843. HSA1=0:HSA2=0:HSA3=0
  1844. HSEnterMode = True
  1845. hsCurrentDigit = 0
  1846. hsCurrentLetter = 1:HSA1=1
  1847. HighScoreFlashTimer.Interval = 250
  1848. HighScoreFlashTimer.Enabled = True
  1849. hsLetterFlash = hsFlashDelay
  1850. End Sub
  1851.  
  1852. Sub HighScoreFlashTimer_Timer()
  1853. hsLetterFlash = hsLetterFlash-1
  1854. UpdatePostIt
  1855. If hsLetterFlash=0 then 'switch back
  1856. hsLetterFlash = hsFlashDelay
  1857. end if
  1858. End Sub
  1859.  
  1860.  
  1861. ' ***********************************************************
  1862. ' HiScore ENTER INITIALS
  1863. ' ***********************************************************
  1864.  
  1865. Sub HighScoreProcessKey(keycode)
  1866. If keycode = LeftFlipperKey Then
  1867. hsLetterFlash = hsFlashDelay
  1868. Select Case hsCurrentLetter
  1869. Case 1:
  1870. HSA1=HSA1-1:If HSA1=-1 Then HSA1=26 'no backspace on 1st digit
  1871. UpdatePostIt
  1872. Case 2:
  1873. HSA2=HSA2-1:If HSA2=-1 Then HSA2=27
  1874. UpdatePostIt
  1875. Case 3:
  1876. HSA3=HSA3-1:If HSA3=-1 Then HSA3=27
  1877. UpdatePostIt
  1878. End Select
  1879. End If
  1880.  
  1881. If keycode = RightFlipperKey Then
  1882. hsLetterFlash = hsFlashDelay
  1883. Select Case hsCurrentLetter
  1884. Case 1:
  1885. HSA1=HSA1+1:If HSA1>26 Then HSA1=0
  1886. UpdatePostIt
  1887. Case 2:
  1888. HSA2=HSA2+1:If HSA2>27 Then HSA2=0
  1889. UpdatePostIt
  1890. Case 3:
  1891. HSA3=HSA3+1:If HSA3>27 Then HSA3=0
  1892. UpdatePostIt
  1893. End Select
  1894. End If
  1895.  
  1896. If keycode = StartGameKey Then
  1897. Select Case hsCurrentLetter
  1898. Case 1:
  1899. hsCurrentLetter=2 'ok to advance
  1900. HSA2=HSA1 'start at same alphabet spot
  1901. ' EMReelHSName1.SetValue HSA1:EMReelHSName2.SetValue HSA2
  1902. Case 2:
  1903. If HSA2=27 Then 'bksp
  1904. HSA2=0
  1905. hsCurrentLetter=1
  1906. Else
  1907. hsCurrentLetter=3 'enter it
  1908. HSA3=HSA2 'start at same alphabet spot
  1909. End If
  1910. Case 3:
  1911. If HSA3=27 Then 'bksp
  1912. HSA3=0
  1913. hsCurrentLetter=2
  1914. Else
  1915. savehs 'enter it
  1916. HighScoreFlashTimer.Enabled = False
  1917. HSEnterMode = False
  1918. End If
  1919. End Select
  1920. UpdatePostIt
  1921. End If
  1922. End Sub
Advertisement
Add Comment
Please, Sign In to add comment