Outhere

Stripping Funny (Inder 1974)_v0.3

Sep 21st, 2021 (edited)
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.57 KB | None | 0 0
  1. Option Explicit
  2.  
  3. ' Stripping Funny 1974
  4.  
  5. '*****************************************************************************************************
  6. ' CREDITS
  7. ' Initial table created by fuzzel, jimmyfingers, jpsalas, toxie & unclewilly (in alphabetical order)
  8. ' Flipper primitives by zany
  9. ' Ball rolling sound script by jpsalas
  10. ' Ball shadow by ninuzzu
  11. ' Ball control & ball dropping sound by rothbauerw
  12. ' DOF by arngrim
  13. ' Positional sound helper functions by djrobx
  14. ' Plus a lot of input from the whole community (sorry if we forgot you :/)
  15. '*****************************************************************************************************
  16.  
  17. 'DOF UpDated by Outhere
  18. '101 Left Flipper
  19. '102 Right Flipper
  20. '103 Left Slingshot
  21. '104 Right Slingshot
  22. '105 Bumper Left
  23. '106 Bumper Center
  24. '107 Bumper Right
  25. '108 Bumper Left Lower
  26. '109 Bumper Right Lower
  27. '110 Ball Release
  28. '111 Kicker_red Right
  29. '112 Kicker_blue Left
  30. '113 Knocker
  31. '114
  32. '115
  33. '116
  34. '117
  35. '118
  36. '119
  37. '120 chime1
  38. '121 chime2
  39. '122 chime3
  40. '123 Bell
  41.  
  42.  
  43. 'First, try to load the Controller.vbs (DOF), which helps controlling additional hardware like lights, gears, knockers, bells and chimes (to increase realism)
  44. 'This table uses DOF via the 'SoundFX' calls that are inserted in some of the PlaySound commands, which will then fire an additional event, instead of just playing a sample/sound effect
  45. On Error Resume Next
  46. ExecuteGlobal GetTextFile("controller.vbs")
  47. If Err Then MsgBox "You need the Controller.vbs file in order to run this table (installed with the VPX package in the scripts folder)"
  48. On Error Goto 0
  49.  
  50. 'If using Visual PinMAME (VPM), place the ROM/game name in the constant below,
  51. 'both for VPM, and DOF to load the right DOF config from the Configtool, whether it's a VPM or an Original table
  52.  
  53. Const cGameName = "stripping_funny"
  54. Const cController = 3
  55.  
  56.  
  57. Dim EnableRetractPlunger
  58. EnableRetractPlunger = false 'Change to true to enable retracting the plunger at a linear speed; wait for 1 second at the maximum position; move back towards the resting position; nice for button/key plungers
  59.  
  60.  
  61. If Table1.ShowDT = false then
  62. EMReel.Visible = false
  63. ShootAgainText.Visible = False
  64. TextBoxGameOver.Visible = False
  65. TextBoxRollover.Visible = False
  66. End If
  67.  
  68. Dim Controller
  69. Dim EnableBallControl
  70. EnableBallControl = false 'Change to true to enable manual ball control (or press C in-game) via the arrow keys and B (boost movement) keys
  71.  
  72.  
  73.  
  74. '#####################################################################################################################################
  75. Const BallSize = 50 'Ball radius
  76. Const BallMass = 1.7
  77. Const maxBalls =3
  78. Dim aa,GameStarted,BIP,PlayerScore,CurrentBall,bonus,Alit,Blit,Clit,Dlit,Elit,Flit,Redlit,TopPoints, BellRing, Chime, Special, SpecialOn, ShootAgain,A5K,B5K,E5K,F5K,lbonus,rbonus
  79.  
  80. Sub Table1_Init()
  81. LoadEM
  82. If Table1.ShowDT = True then
  83. ShootAgainText.Visible = False
  84. TextBoxGameOver.visible = True
  85. TextBoxRollover.Visible = False
  86. End If
  87. loadhs
  88. if HSA1="" then HSA1=25
  89. if HSA2="" then HSA2=25
  90. if HSA3="" then HSA3=25
  91. UpdatePostIt
  92. For each aa In aBIP
  93. aa.Opacity = 0
  94. Next
  95. If B2SOn Then Controller.B2SSetGameOver 1 'turn off Gameover light
  96. End Sub
  97.  
  98. Sub StartGame
  99. if not GameStarted Then
  100. If Table1.ShowDT = True then
  101. TextBoxGameOver.Visible = False
  102. ShootAgainText.Visible = False
  103. TextBoxRollover.Visible = False
  104. End If
  105. If B2SOn Then Controller.B2SStopAnimation "Attract" 'turn off Attract
  106. If B2SOn Then Controller.B2SSetGameOver 0 'turn off Gameover light
  107. If B2SOn Then Controller.B2SSetScore 1, PlayerScore
  108. BIP = 0
  109. EMReel.setvalue(0)
  110. GameStarted = True
  111. 'GameEndTimer.enabled = False
  112. ResetState
  113. PlayerScore=0
  114. debug.print "########## Start Game ############"
  115. NextBall
  116.  
  117.  
  118.  
  119. end If
  120. End Sub
  121.  
  122. Sub GameOver
  123. GameStarted = False
  124. If B2SOn Then Controller.B2SStartAnimation "Attract" 'turn off Attract
  125. If B2SOn Then Controller.B2SSetGameOver 1 'turn off Gameover light
  126. If Table1.ShowDT = True then TextBoxGameOver.Visible = True
  127. CheckNewHighScorePostIt(PlayerScore)
  128. End Sub
  129.  
  130. Sub ResetState
  131. bonus=0
  132. Special = 0
  133. SpecialOn = Int(Rnd*6)
  134. Alit=False
  135. Blit=False
  136. Clit=False
  137. Dlit=False
  138. Elit=False
  139. Flit=False
  140. A5K = False
  141. B5K = False
  142. E5K = True
  143. F5K = True
  144. lbonus = True
  145. rbonus = False
  146. Redlit=False
  147. ShootAgain = False
  148. TopPoints=500
  149. For each aa In aLights
  150. aa.State = 0
  151. Next
  152. For each aa In aLights2
  153. aa.State = 1
  154. Next
  155. For each aa In aLightsSpecial
  156. aa.State = 0
  157. Next
  158. If Table1.ShowDT = True then ShootAgainText.Visible = False
  159. End Sub
  160.  
  161. Sub NextBall()
  162. if BIP < maxBalls Then
  163. If ShootAgain = False Then BIP = BIP + 1 End If
  164. ResetState
  165. For each aa In aBIP
  166. aa.Opacity = 0
  167. Next
  168. aBIP(BIP-1).Opacity = 100
  169. BallRelease.CreateBall
  170. BallRelease.Kick 90, 7
  171. PlaySound SoundFXDOF("ballrelease", 110, DOFPulse, DOFContactors), 0,1,AudioPan(BallRelease),0.25,0,0,1,AudioFade(BallRelease)
  172. Else
  173. GameOver
  174. End If
  175. End Sub
  176.  
  177.  
  178.  
  179. Sub Addpoints(ScorePar)
  180. if GameStarted Then
  181. Select Case ScorePar
  182. Case 10 : PlaySound SoundFXDOF("chime1", 120, DOFPulse, DOFChimes)
  183. Case 100 : PlaySound SoundFXDOF("chime2", 121, DOFPulse, DOFChimes)
  184. Case 500 : Chime =2: BellRing = 1 : BellTimer.enabled = 1
  185. Case 1000 : PlaySound SoundFXDOF("chime3", 122, DOFPulse, DOFChimes)
  186. Case 5000 : Chime =3: BellRing = 1 : BellTimer.enabled = 1
  187. End Select
  188. PlayerScore = PlayerScore + ScorePar
  189. EMReel.setvalue(PlayerScore)
  190. If B2SOn Then Controller.B2SSetScore 1, PlayerScore
  191. If PlayerScore >99999 Then
  192. If Table1.ShowDT = True then TextBoxRollover.Visible = True
  193. If B2SOn Then Controller.B2SSetScoreRollover 25, 1
  194. End If
  195. End If
  196.  
  197. End Sub
  198.  
  199. Sub ScoreTimer_timer
  200. If bonus >0 Then
  201. Addpoints(1000)
  202. BonusLadder(bonus-1).State = 0
  203. bonus = bonus - 1
  204. Else
  205. NextBall
  206. me.Enabled = 0
  207. End If
  208. End Sub
  209.  
  210. Sub AddBonus()
  211. debug.Print bonus
  212. If bonus <10 Then
  213. bonus = bonus + 1
  214. BonusLadder(bonus-1).state = 1
  215. End IF
  216. End Sub
  217.  
  218. Sub BellTimer_Timer
  219. PlaySound SoundFXDOF("chime", 123, DOFPulse, DOFBell)&Chime
  220. BellRing = BellRing - 1
  221. If BellRing < 1 Then
  222. SpecialSet
  223. BellTimer.enabled = 0
  224. End If
  225. End Sub
  226.  
  227. Sub SpecialSet
  228. 'Special = 6
  229. If Special = 6 Then
  230. If SpecialOn <5 Then
  231. aLightsSpecial(SpecialOn).State = 0
  232. SpecialOn = SpecialOn +1
  233. aLightsSpecial(SpecialOn).State = 2
  234. Else
  235. aLightsSpecial(5).State = 0
  236. SpecialOn = 0
  237. aLightsSpecial(SpecialOn).State = 2
  238. End If
  239. End If
  240. DEBUG.PRINT "special" & Special & " specialon" & SpecialOn
  241. End Sub
  242.  
  243. Sub SpecialHit
  244. ShootAgain = True
  245. If B2SOn Then Controller.B2SSetShootAgain 1
  246. If Table1.ShowDT = True then ShootAgainText.Visible = True
  247. Special = 0
  248. PlaySound SoundFXDOF("Knocker", 113, DOFPulse, DOFKnocker)
  249. aLightsSpecial(SpecialOn).State = 0
  250. debug.print "###################EXTRA BALL################"
  251. End Sub
  252.  
  253. Sub Toggle_Bonus
  254. If lbonus = True Then
  255. Light_LBonus.State = 0
  256. Light_RBonus.State = 1
  257. lbonus = False
  258. rbonus = True
  259. Else
  260. Light_LBonus.State = 1
  261. Light_RBonus.State = 0
  262. lbonus = True
  263. rbonus = False
  264. End If
  265. End Sub
  266. '#########################################################################
  267. '### Scoring
  268.  
  269. Sub Trigger_A_Hit
  270. PlaySound "fx_sensor",0,1,AudioPan(Trigger_A),0.25,0,0,1,AudioFade(Trigger_A)
  271. If Alit =False Then
  272. Alit =True
  273. Special = Special +1
  274. Light_A.State = 1
  275. Light_A1.State = 1
  276. Light_A2.State = 1
  277. Light_A3.State = 0
  278. Light_A4.State = 0
  279. Light_A5K.State = 1
  280. A5K = True
  281. E5K = False
  282. F5K = False
  283. Light_E5k.state = 0
  284. Light_F5k.state = 0
  285. If Blit = True Then
  286. TopPoints = 5000
  287. End If
  288. Else
  289. AddBonus
  290. End If
  291. Addpoints(TopPoints)
  292. End Sub
  293.  
  294. Sub Trigger_B_Hit
  295. PlaySound "fx_sensor",0,1,AudioPan(Trigger_B),0.25,0,0,1,AudioFade(Trigger_B)
  296. If Blit =False Then
  297. Blit =True
  298. Special = Special +1
  299. Light_B.State = 1
  300. Light_B1.State = 1
  301. Light_B2.State = 1
  302. Light_B3.State = 0
  303. Light_B4.State = 0
  304. Light_B5K.State = 1
  305. B5K = True
  306. E5K = False
  307. F5K = False
  308. Light_E5k.state = 0
  309. Light_F5k.state = 0
  310. If Alit = True Then
  311. TopPoints = 5000
  312. End If
  313. Else
  314. AddBonus
  315. End If
  316. Addpoints(TopPoints)
  317. End Sub
  318.  
  319. Sub Trigger_C_Hit
  320. PlaySound "fx_sensor",0,1,AudioPan(Trigger_C),0.25,0,0,1,AudioFade(Trigger_C)
  321. If Clit =False Then
  322. Clit =True
  323. Special = Special +1
  324. Light_C.State = 1
  325. Light_C1.State = 1
  326. Light_C3.State = 0
  327. E5K = False
  328. F5K = False
  329. Light_E5k.state = 0
  330. Light_F5k.state = 0
  331. Else
  332. AddBonus
  333. End If
  334. Addpoints(500)
  335. End Sub
  336.  
  337. Sub Trigger_D_Hit
  338. PlaySound "fx_sensor",0,1,AudioPan(Trigger_D),0.25,0,0,1,AudioFade(Trigger_D)
  339. If Dlit =False Then
  340. Dlit =True
  341. Special = Special +1
  342. Light_D.State = 1
  343. Light_D1.State = 1
  344. Light_D3.State = 0
  345. E5K = False
  346. F5K = False
  347. Light_E5k.state = 0
  348. Light_F5k.state = 0
  349. Else
  350. AddBonus
  351. End If
  352. If Special = 6 and SpecialOn = 3 Then SpecialHit
  353. Addpoints(500)
  354. End Sub
  355.  
  356. Sub Trigger_red_on_Hit
  357. If Redlit =False Then
  358. Redlit =True
  359. Light_Red.State = 1
  360. Light_red_on.state = 1
  361. Light_red_off.state = 0
  362. End If
  363. End Sub
  364.  
  365. Sub Trigger_red_off_Hit
  366. If Redlit =True Then
  367. Redlit =False
  368. Light_Red.State = 0
  369. Light_red_on.state = 0
  370. Light_red_off.state = 1
  371. End If
  372. End Sub
  373.  
  374. Sub Target_E_Hit
  375. PlaySound "target",0,1,AudioPan(Target_E),0.25,0,0,1,AudioFade(Target_E)
  376. If Elit =False Then
  377. Elit =True
  378. Special = Special +1
  379. Light_E1.State = 1
  380. Light_E3.State = 0
  381. Else
  382. AddBonus
  383. End If
  384. If Special = 6 and SpecialOn = 5 Then SpecialHit
  385. If E5K = True Then Addpoints(5000) Else Addpoints(500)
  386. End Sub
  387.  
  388. Sub Target_F_Hit
  389. PlaySound "target",0,1,AudioPan(Target_F),0.25,0,0,1,AudioFade(Target_F)
  390. If Flit =False Then
  391. Flit =True
  392. Special = Special +1
  393. Light_F1.State = 1
  394. Light_F3.State = 0
  395. Else
  396. AddBonus
  397. End If
  398. If Special = 6 and SpecialOn = 2 Then SpecialHit
  399. If F5K = True Then Addpoints(5000) Else Addpoints(500)
  400. End Sub
  401.  
  402. Sub LeftInlane_Hit
  403. PlaySound "fx_sensor",0,1,AudioPan(LeftInlane),0.25,0,0,1,AudioFade(LeftInlane)
  404. If B5K = True Then Addpoints(5000)
  405. End Sub
  406.  
  407. Sub RightInlane_Hit
  408. PlaySound "fx_sensor",0,1,AudioPan(RightInlane),0.25,0,0,1,AudioFade(RightInlane)
  409. If A5K = True Then Addpoints(5000)
  410. End Sub
  411.  
  412. Sub LeftOutlane_Hit
  413. PlaySound "fx_sensor",0,1,AudioPan(LeftOutlane),0.25,0,0,1,AudioFade(LeftOutlane)
  414. If Special = 6 and SpecialOn = 4 Then SpecialHit
  415. If lbonus = True Then AddBonus
  416. End Sub
  417.  
  418. Sub RightOutlane_Hit
  419. PlaySound "fx_sensor",0,1,AudioPan(RightOutlane),0.25,0,0,1,AudioFade(RightOutlane)
  420. If Special = 6 and SpecialOn = 3 Then SpecialHit
  421. If rbonus = True Then AddBonus
  422. End Sub
  423.  
  424. Sub Bumper_A_Hit
  425. PlaySound SoundFXDOF("fx_bumper4", 105, DOFPulse, DOFContactors), 0,1,AudioPan(Bumper_A),0,0,0,1,AudioFade(Bumper_A)
  426. If Alit =True Then
  427. Addpoints(100)
  428. Else Addpoints(10) End If
  429. End Sub
  430.  
  431. Sub Bumper_B_Hit
  432. PlaySound SoundFXDOF("fx_bumper4", 107, DOFPulse, DOFContactors), 0,1,AudioPan(Bumper_B),0,0,0,1,AudioFade(Bumper_B)
  433. If Blit =True Then
  434. Addpoints(100)
  435. Else Addpoints(10) End If
  436. End Sub
  437.  
  438. Sub Bumper_C_Hit
  439. PlaySound SoundFXDOF("fx_bumper4", 108, DOFPulse, DOFContactors), 0,1,AudioPan(Bumper_C),0,0,0,1,AudioFade(Bumper_C)
  440. If Clit =True Then
  441. Addpoints(100)
  442. Else Addpoints(10) End If
  443. End Sub
  444.  
  445.  
  446. Sub Bumper_D_Hit
  447. PlaySound SoundFXDOF("fx_bumper4", 109, DOFPulse, DOFContactors), 0,1,AudioPan(Bumper_D),0,0,0,1,AudioFade(Bumper_D)
  448. If Dlit =True Then
  449. Addpoints(100)
  450. Else Addpoints(10) End If
  451. End Sub
  452.  
  453. Sub Bumper_Red_Hit
  454. PlaySound SoundFXDOF("fx_bumper4", 106, DOFPulse, DOFContactors), 0,1,AudioPan(Bumper_Red),0,0,0,1,AudioFade(Bumper_Red)
  455. If Redlit =True Then Addpoints(1000) Else Addpoints(10) End If
  456. End Sub
  457.  
  458. Sub Target_adv_bonus_Hit
  459. AddBonus
  460. End Sub
  461.  
  462. Sub Kicker_red_Hit
  463. me.timerenabled = True
  464. End Sub
  465.  
  466. Sub Kicker_red_Timer
  467. me.Kick 200, 7
  468. PlaySound SoundFXDOF("popper_ball", 111, DOFPulse, DOFContactors), 0,1,AudioPan(Kicker_red),0,0,0,1,AudioFade(Kicker_red)
  469. If Special = 6 and SpecialOn = 1 Then SpecialHit
  470. Addpoints(500)
  471. me.timerenabled = False
  472. End Sub
  473.  
  474. Sub Kicker_blue_Hit
  475. me.timerenabled = True
  476. End Sub
  477.  
  478. Sub Kicker_blue_Timer
  479. me.Kick 160, 7
  480. PlaySound SoundFXDOF("popper_ball", 112, DOFPulse, DOFContactors), 0,1,AudioPan(Kicker_blue),0,0,0,1,AudioFade(Kicker_blue)
  481. If Special = 6 and SpecialOn = 0 Then SpecialHit
  482. Addpoints(500)
  483. me.timerenabled = False
  484. End Sub
  485.  
  486. '##########################################################################################################
  487. dim rms,lms
  488. Sub Table1_KeyDown(ByVal keycode)
  489. If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
  490.  
  491. If Keycode = StartGameKey And Not HSEnterMode=true And not rms = true Then
  492. StartGame
  493. Elseif keycode = StartGameKey And Not HSEnterMode=true And rms = true Then
  494. deletehs
  495. End If
  496. If keycode = LeftMagnaSave Then lms = True
  497. If keycode = RightMagnaSave And lms = True Then rms = True
  498.  
  499. If HSEnterMode Then
  500. HighScoreProcessKey(keycode)
  501. End If
  502.  
  503. If keycode = LeftFlipperKey Then
  504. LeftFlipper.TimerEnabled = True 'This line is only for ninuzzu's flipper shadows!
  505. LeftFlipper.RotateToEnd
  506. PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), 0, .67, AudioPan(LeftFlipper), 0.05,0,0,1,AudioFade(LeftFlipper)
  507. End If
  508.  
  509. If keycode = RightFlipperKey Then
  510. RightFlipper.TimerEnabled = True 'This line is only for ninuzzu's flipper shadows!
  511. RightFlipper.RotateToEnd
  512. PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), 0, .67, AudioPan(RightFlipper), 0.05,0,0,1,AudioFade(RightFlipper)
  513. End If
  514.  
  515. If keycode = LeftTiltKey Then
  516. Nudge 90, 2
  517. End If
  518.  
  519. If keycode = RightTiltKey Then
  520. Nudge 270, 2
  521. End If
  522.  
  523. If keycode = CenterTiltKey Then
  524. Nudge 0, 2
  525. End If
  526.  
  527. ' Manual Ball Control
  528. If keycode = 46 Then ' C Key
  529. If EnableBallControl = 1 Then
  530. EnableBallControl = 0
  531. Else
  532. EnableBallControl = 1
  533. End If
  534. End If
  535. If EnableBallControl = 1 Then
  536. If keycode = 48 Then ' B Key
  537. If BCboost = 1 Then
  538. BCboost = BCboostmulti
  539. Else
  540. BCboost = 1
  541. End If
  542. End If
  543. If keycode = 203 Then BCleft = 1 ' Left Arrow
  544. If keycode = 200 Then BCup = 1 ' Up Arrow
  545. If keycode = 208 Then BCdown = 1 ' Down Arrow
  546. If keycode = 205 Then BCright = 1 ' Right Arrow
  547. End If
  548. End Sub
  549.  
  550. Sub Table1_KeyUp(ByVal keycode)
  551. If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
  552. If keycode = RightMagnaSave Then rms = False
  553. If keycode = LeftMagnaSave Then lms = False
  554.  
  555. If keycode = LeftFlipperKey Then
  556. LeftFlipper.RotateToStart
  557. PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), 0, 1, AudioPan(LeftFlipper), 0.05,0,0,1,AudioFade(LeftFlipper)
  558. End If
  559.  
  560. If keycode = RightFlipperKey Then
  561. RightFlipper.RotateToStart
  562. PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), 0, 1, AudioPan(RightFlipper), 0.05,0,0,1,AudioFade(RightFlipper)
  563. End If
  564.  
  565. 'Manual Ball Control
  566. If EnableBallControl = 1 Then
  567. If keycode = 203 Then BCleft = 0 ' Left Arrow
  568. If keycode = 200 Then BCup = 0 ' Up Arrow
  569. If keycode = 208 Then BCdown = 0 ' Down Arrow
  570. If keycode = 205 Then BCright = 0 ' Right Arrow
  571. End If
  572. End Sub
  573.  
  574.  
  575. Sub Drain_Hit()
  576. PlaySound "drain",0,1,AudioPan(Drain),0.25,0,0,1,AudioFade(Drain)
  577. Drain.DestroyBall
  578. ScoreTimer.Enabled = 1
  579. End Sub
  580.  
  581.  
  582.  
  583.  
  584.  
  585. '*****GI Lights On
  586. dim xx
  587.  
  588. For each xx in GI:xx.State = 1: Next
  589.  
  590. '**********Sling Shot Animations
  591. ' Rstep and Lstep are the variables that increment the animation
  592. '****************
  593. Dim RStep, Lstep
  594.  
  595. Sub RightSlingShot_Slingshot
  596. PlaySound SoundFXDOF("right_slingshot", 104, DOFPulse, DOFContactors), 0,1, 0.05,0.05 '0,1, AudioPan(RightSlingShot), 0.05,0,0,1,AudioFade(RightSlingShot)
  597. RSling.Visible = 0
  598. RSling1.Visible = 1
  599. sling1.rotx = 20
  600. RStep = 0
  601. RightSlingShot.TimerEnabled = 1
  602. Toggle_Bonus
  603. End Sub
  604.  
  605. Sub RightSlingShot_Timer
  606. Select Case RStep
  607. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.rotx = 10
  608. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.rotx = 0:RightSlingShot.TimerEnabled = 0
  609. End Select
  610. RStep = RStep + 1
  611. End Sub
  612.  
  613. Sub LeftSlingShot_Slingshot
  614. PlaySound SoundFXDOF("left_slingshot", 103, DOFPulse, DOFContactors), 0,1, -0.05,0.05 '0,1, AudioPan(LeftSlingShot), 0.05,0,0,1,AudioFade(LeftSlingShot)
  615. LSling.Visible = 0
  616. LSling1.Visible = 1
  617. sling2.rotx = 20
  618. LStep = 0
  619. LeftSlingShot.TimerEnabled = 1
  620. Toggle_Bonus
  621. End Sub
  622.  
  623. Sub LeftSlingShot_Timer
  624. Select Case LStep
  625. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.rotx = 10
  626. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.rotx = 0:LeftSlingShot.TimerEnabled = 0
  627. End Select
  628. LStep = LStep + 1
  629. End Sub
  630.  
  631.  
  632. '*********************************************************************
  633. ' Positional Sound Playback Functions
  634. '*********************************************************************
  635.  
  636. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  637. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  638. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  639. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  640. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  641. End Sub
  642.  
  643. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  644. Sub PlaySoundAt(soundname, tableobj)
  645. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  646. End Sub
  647.  
  648. Sub PlaySoundAtBall(soundname)
  649. PlaySoundAt soundname, ActiveBall
  650. End Sub
  651.  
  652.  
  653. '*********************************************************************
  654. ' Supporting Ball & Sound Functions
  655. '*********************************************************************
  656. Dim TableWidth, TableHeight
  657.  
  658. TableWidth = Table1.width
  659. TableHeight = Table1.height
  660.  
  661.  
  662.  
  663. 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
  664. Dim tmp
  665. tmp = tableobj.y * 2 / TableHeight-1
  666. If tmp > 0 Then
  667. AudioFade = Csng(tmp ^10)
  668. Else
  669. AudioFade = Csng(-((- tmp) ^10) )
  670. End If
  671. End Function
  672.  
  673. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  674. Dim tmp
  675. tmp = tableobj.x * 2 / TableWidth-1
  676. If tmp > 0 Then
  677. AudioPan = Csng(tmp ^10)
  678. Else
  679. AudioPan = Csng(-((- tmp) ^10) )
  680. End If
  681. End Function
  682.  
  683. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  684. Vol = Csng(BallVel(ball) ^2 / 2000)
  685. End Function
  686.  
  687. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  688. Pitch = BallVel(ball) * 20
  689. End Function
  690.  
  691. Function BallVel(ball) 'Calculates the ball speed
  692. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  693. End Function
  694.  
  695.  
  696. '*****************************************
  697. ' rothbauerw's Manual Ball Control
  698. '*****************************************
  699.  
  700. Dim BCup, BCdown, BCleft, BCright
  701. Dim ControlBallInPlay, ControlActiveBall
  702. Dim BCvel, BCyveloffset, BCboostmulti, BCboost
  703.  
  704. BCboost = 1 'Do Not Change - default setting
  705. BCvel = 4 'Controls the speed of the ball movement
  706. BCyveloffset = -0.01 'Offsets the force of gravity to keep the ball from drifting vertically on the table, should be negative
  707. BCboostmulti = 3 'Boost multiplier to ball veloctiy (toggled with the B key)
  708.  
  709. ControlBallInPlay = false
  710.  
  711. Sub StartBallControl_Hit()
  712. Set ControlActiveBall = ActiveBall
  713. ControlBallInPlay = true
  714. End Sub
  715.  
  716. Sub StopBallControl_Hit()
  717. ControlBallInPlay = false
  718. End Sub
  719.  
  720. Sub BallControlTimer_Timer()
  721. If EnableBallControl and ControlBallInPlay then
  722. If BCright = 1 Then
  723. ControlActiveBall.velx = BCvel*BCboost
  724. ElseIf BCleft = 1 Then
  725. ControlActiveBall.velx = -BCvel*BCboost
  726. Else
  727. ControlActiveBall.velx = 0
  728. End If
  729.  
  730. If BCup = 1 Then
  731. ControlActiveBall.vely = -BCvel*BCboost
  732. ElseIf BCdown = 1 Then
  733. ControlActiveBall.vely = BCvel*BCboost
  734. Else
  735. ControlActiveBall.vely = bcyveloffset
  736. End If
  737. End If
  738. End Sub
  739.  
  740.  
  741. '********************************************************************
  742. ' JP's VP10 Rolling Sounds (+rothbauerw's Dropping Sounds)
  743. '********************************************************************
  744.  
  745. Const tnob = 4 ' total number of balls
  746. ReDim rolling(tnob)
  747. Dim shadowm,shadowc
  748. shadowc=Ballsize*0.75 'distance of shadow from ball at the furthest point
  749. shadowm= ((TableWidth/2)+shadowc)/(TableWidth/2) 'slope of the linear change around the centerpoint of the table
  750. InitRolling
  751.  
  752. Sub InitRolling
  753. Dim i
  754. For i = 0 to tnob
  755. rolling(i) = False
  756. Next
  757. End Sub
  758.  
  759. Sub RollingTimer_Timer()
  760. Dim BOT, b,speedfactorx,speedfactory
  761. Const maxvel = 30 'max ball velocity
  762. BOT = GetBalls
  763.  
  764. ' stop the sound of deleted balls
  765. For b = UBound(BOT) + 1 to tnob
  766. rolling(b) = False
  767. StopSound("fx_ballrolling" & b)
  768. aBallShadow(b).visible = 0
  769. Next
  770.  
  771. ' exit the sub if no balls on the table
  772. If UBound(BOT) = -1 Then Exit Sub
  773.  
  774. For b = 0 to UBound(BOT)
  775. aBallShadow(b).X = shadowm*BOT(b).X - shadowc'y=mx+c
  776. aBallShadow(b).Y = BOT(b).Y + 12
  777. If BOT(b).Z > 20 Then
  778. aBallShadow(b).visible = 1
  779. 'debug.Print aBallShadow(b).X
  780. Else
  781. aBallShadow(b).visible = 0
  782. End If
  783. If BOT(b).VelX AND BOT(b).VelY <> 0 Then
  784. speedfactorx = ABS(maxvel / BOT(b).VelX)
  785. speedfactory = ABS(maxvel / BOT(b).VelY)
  786. If speedfactorx <1 Then
  787. BOT(b).VelX = BOT(b).VelX * speedfactorx
  788. BOT(b).VelY = BOT(b).VelY * speedfactorx
  789. End If
  790. If speedfactory <1 Then
  791. BOT(b).VelX = BOT(b).VelX * speedfactory
  792. BOT(b).VelY = BOT(b).VelY * speedfactory
  793. End If
  794. End If
  795. ' play the rolling sound for each ball
  796. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  797. rolling(b) = True
  798. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  799. Else
  800. If rolling(b) = True Then
  801. StopSound("fx_ballrolling" & b)
  802. rolling(b) = False
  803. End If
  804. End If
  805.  
  806. ' play ball drop sounds
  807. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  808. PlaySound "fx_ball_drop" & b, 0, ABS(BOT(b).velz)/17, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  809. End If
  810. Next
  811. End Sub
  812.  
  813.  
  814. '**********************
  815. ' Ball Collision Sound
  816. '**********************
  817.  
  818. Sub OnBallBallCollision(ball1, ball2, velocity)
  819. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  820. End Sub
  821.  
  822.  
  823. '*****************************************
  824. ' ninuzzu's FLIPPER SHADOWS v2
  825. '*****************************************
  826.  
  827. 'Add TimerEnabled=True to Table1_KeyDown procedure
  828. ' Example :
  829. 'Sub Table1_KeyDown(ByVal keycode)
  830. ' If keycode = LeftFlipperKey Then
  831. ' LeftFlipper.TimerEnabled = True 'Add this
  832. ' LeftFlipper.RotateToEnd
  833. ' End If
  834. ' If keycode = RightFlipperKey Then
  835. ' RightFlipper.TimerEnabled = True 'And add this
  836. ' RightFlipper.RotateToEnd
  837. ' End If
  838. 'End Sub
  839.  
  840. Sub LeftFlipper_Init()
  841. LeftFlipper.TimerInterval = 10
  842. End Sub
  843.  
  844. Sub RightFlipper_Init()
  845. RightFlipper.TimerInterval = 10
  846. End Sub
  847.  
  848. Sub LeftFlipper_Timer()
  849. FlipperLSh.RotZ = LeftFlipper.CurrentAngle
  850. If LeftFlipper.CurrentAngle = LeftFlipper.StartAngle Then
  851. LeftFlipper.TimerEnabled = False
  852. End If
  853. End Sub
  854.  
  855. Sub RightFlipper_Timer()
  856. FlipperRSh.RotZ = RightFlipper.CurrentAngle
  857. If RightFlipper.CurrentAngle = RightFlipper.StartAngle Then
  858. RightFlipper.TimerEnabled = False
  859. End If
  860. End Sub
  861.  
  862.  
  863.  
  864. '************************************
  865. ' What you need to add to your table
  866. '************************************
  867.  
  868. ' a timer called RollingTimer. With a fast interval, like 10
  869. ' one collision sound, in this script is called fx_collide
  870. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  871. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  872.  
  873.  
  874. '******************************************
  875. ' Explanation of the rolling sound routine
  876. '******************************************
  877.  
  878. ' sounds are played based on the ball speed and position
  879.  
  880. ' the routine checks first for deleted balls and stops the rolling sound.
  881.  
  882. ' The For loop goes through all the balls on the table and checks for the ball speed and
  883. ' if the ball is on the table (height lower than 30) then then it plays the sound
  884. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  885.  
  886. ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
  887. ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
  888. ' according to the position of the ball on the table.
  889.  
  890.  
  891. '**************************************
  892. ' Explanation of the collision routine
  893. '**************************************
  894.  
  895. ' The collision is built in VP.
  896. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  897. ' 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
  898. ' depending of the speed of the collision.
  899.  
  900.  
  901. Sub Pins_Hit (idx)
  902. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  903. End Sub
  904.  
  905. Sub Targets_Hit (idx)
  906. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  907. End Sub
  908.  
  909. Sub Metals_Thin_Hit (idx)
  910. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  911. End Sub
  912.  
  913. Sub Metals_Medium_Hit (idx)
  914. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  915. End Sub
  916.  
  917. Sub Metals2_Hit (idx)
  918. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  919. End Sub
  920.  
  921. Sub Gates_Hit (idx)
  922. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  923. End Sub
  924.  
  925. Sub Spinner_Spin
  926. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  927. End Sub
  928.  
  929. Sub Rubbers_Hit(idx)
  930. dim finalspeed
  931. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  932. If finalspeed > 20 then
  933. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  934. End if
  935. If finalspeed >= 6 AND finalspeed <= 20 then
  936. RandomSoundRubber()
  937. End If
  938. End Sub
  939.  
  940. Sub Posts_Hit(idx)
  941. dim finalspeed
  942. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  943. If finalspeed > 16 then
  944. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  945. End if
  946. If finalspeed >= 6 AND finalspeed <= 16 then
  947. RandomSoundRubber()
  948. End If
  949. End Sub
  950.  
  951. Sub RandomSoundRubber()
  952. Select Case Int(Rnd*3)+1
  953. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  954. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  955. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  956. End Select
  957. End Sub
  958.  
  959. Sub LeftFlipper_Collide(parm)
  960. RandomSoundFlipper()
  961. End Sub
  962.  
  963. Sub RightFlipper_Collide(parm)
  964. RandomSoundFlipper()
  965. End Sub
  966.  
  967. Sub RandomSoundFlipper()
  968. Select Case Int(Rnd*3)+1
  969. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  970. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  971. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  972. End Select
  973. End Sub
  974.  
  975.  
  976. '==========================================================================================================================================
  977. '============================================================= START OF HIGH SCORES ROUTINES =============================================================
  978. '==========================================================================================================================================
  979. '
  980. 'ADD LINE TO TABLE_KEYDOWN SUB WITH THE FOLLOWING: If HSEnterMode Then HighScoreProcessKey(keycode) AFTER THE STARTGAME ENTRY
  981. 'ADD: And Not HSEnterMode=true TO IF KEYCODE=STARTGAMEKEY
  982. 'TO SHOW THE SCORE ON POST-IT ADD LINE AT RELEVENT LOCATION THAT HAS: UpdatePostIt
  983. 'TO INITIATE ADDING INITIALS ADD LINE AT RELEVENT LOCATION THAT HAS: HighScoreEntryInit()
  984. 'ADD THE FOLLOWING LINES TO TABLE_INIT TO SETUP POSTIT
  985. ' if HSA1="" then HSA1=25
  986. ' if HSA2="" then HSA2=25
  987. ' if HSA3="" then HSA3=25
  988. ' UpdatePostIt
  989. 'ADD HSA1, HSA2 AND HSA3 TO SAVE AND LOAD VALUES FOR TABLE
  990. 'ADD A TIMER NAMED HighScoreFlashTimer WITH INTERVAL 100 TO TABLE
  991. 'SET HSSSCOREX BELOW TO WHATEVER VARIABLE YOU USE FOR HIGH SCORE.
  992. 'ADD OBJECTS TO PLAYFIELD (EASIEST TO JUST COPY FROM THIS TABLE)
  993. 'IMPORT POST-IT IMAGES
  994.  
  995.  
  996. Sub CheckNewHighScorePostIt(newScore)
  997. If CLng(newScore) > CLng(HSAHighScore) Then
  998. HSAHighScore=newScore
  999. HighScoreEntryInit()
  1000. Else
  1001. End If
  1002. End Sub
  1003.  
  1004.  
  1005. Dim HSA1, HSA2, HSA3,HSAHighScore
  1006. Dim HSEnterMode, hsLetterFlash, hsEnteredDigits(3), hsCurrentDigit, hsCurrentLetter
  1007. Dim HSArray
  1008. Dim HSScoreM,HSScore100k, HSScore10k, HSScoreK, HSScore100, HSScore10, HSScore1, HSScorex 'Define 6 different score values for each reel to use
  1009. HSArray = Array("Postit0","postit1","postit2","postit3","postit4","postit5","postit6","postit7","postit8","postit9","postitBL","postitCM","Tape")
  1010. Const hsFlashDelay = 4
  1011. Const HighScoreFilename = "StrippingFunny.txt"
  1012. Dim FileObj,ScoreFile
  1013. sub savehs
  1014. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1015. If Not FileObj.FolderExists(UserDirectory) then
  1016. Exit Sub
  1017. End if
  1018. Set ScoreFile=FileObj.CreateTextFile(UserDirectory & HighScoreFilename,True)
  1019. ScoreFile.WriteLine HSAHighScore
  1020. ScoreFile.WriteLine HSA1
  1021. ScoreFile.WriteLine HSA2
  1022. ScoreFile.WriteLine HSA3
  1023. ScoreFile.Close
  1024. Set ScoreFile=Nothing
  1025. Set FileObj=Nothing
  1026. end sub
  1027.  
  1028. sub loadhs
  1029. Dim FileObj
  1030. Dim ScoreFile
  1031. Dim TextStr
  1032. Dim SavedDataTempScore, SavedDataTempHSA1, SavedDataTempHSA2, SavedDataTempHSA3 'HighScore
  1033. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1034. If Not FileObj.FolderExists(UserDirectory) then
  1035. Exit Sub
  1036. End if
  1037. If Not FileObj.FileExists(UserDirectory & HighScoreFilename) then
  1038. SetDefaultHSTD:UpdatePostIt:savehs
  1039. Exit Sub
  1040. End if
  1041. Set ScoreFile=FileObj.GetFile(UserDirectory & HighScoreFilename)
  1042. Set TextStr=ScoreFile.OpenAsTextStream(1,0)
  1043. If (TextStr.AtEndOfStream=True) then
  1044. SetDefaultHSTD:UpdatePostIt:savehs
  1045. Exit Sub
  1046. End if
  1047. SavedDataTempScore=Textstr.ReadLine ' HighScore
  1048. HSA1=Textstr.ReadLine ' HighScore
  1049. HSA2=Textstr.ReadLine ' HighScore
  1050. HSA3=Textstr.ReadLine ' HighScore
  1051. TextStr.Close
  1052. HSAHighScore=SavedDataTempScore
  1053. UpdatePostIt
  1054. Set ScoreFile = Nothing
  1055. Set FileObj = Nothing
  1056. end sub
  1057.  
  1058. sub deletehs
  1059. debug.print "delete HS file"
  1060. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1061. If FileObj.FileExists(UserDirectory & HighScoreFilename) then
  1062. SetDefaultHSTD:UpdatePostIt:savehs
  1063. Exit Sub
  1064. End if
  1065.  
  1066. end Sub
  1067. Sub SetDefaultHSTD 'bad data or missing file - reset and resave
  1068. HSAHighScore = 10000
  1069. HSA1 = 1
  1070. HSA2 = 1
  1071. HSA3 = 1
  1072. End Sub
  1073.  
  1074.  
  1075. ' ***********************************************************
  1076. ' HiScore DISPLAY
  1077. ' ***********************************************************
  1078.  
  1079. Sub UpdatePostIt
  1080. dim tempscore
  1081. HSScorex = HSAHighScore
  1082. TempScore = HSScorex
  1083. HSScore1 = 0
  1084. HSScore10 = 0
  1085. HSScore100 = 0
  1086. HSScoreK = 0
  1087. HSScore10k = 0
  1088. HSScore100k = 0
  1089. HSScoreM = 0
  1090. if len(TempScore) > 0 Then
  1091. HSScore1 = cint(right(Tempscore,1))
  1092. end If
  1093. if len(TempScore) > 1 Then
  1094. TempScore = Left(TempScore,len(TempScore)-1)
  1095. HSScore10 = cint(right(Tempscore,1))
  1096. end If
  1097. if len(TempScore) > 1 Then
  1098. TempScore = Left(TempScore,len(TempScore)-1)
  1099. HSScore100 = cint(right(Tempscore,1))
  1100. end If
  1101. if len(TempScore) > 1 Then
  1102. TempScore = Left(TempScore,len(TempScore)-1)
  1103. HSScoreK = cint(right(Tempscore,1))
  1104. end If
  1105. if len(TempScore) > 1 Then
  1106. TempScore = Left(TempScore,len(TempScore)-1)
  1107. HSScore10k = cint(right(Tempscore,1))
  1108. end If
  1109. if len(TempScore) > 1 Then
  1110. TempScore = Left(TempScore,len(TempScore)-1)
  1111. HSScore100k = cint(right(Tempscore,1))
  1112. end If
  1113. if len(TempScore) > 1 Then
  1114. TempScore = Left(TempScore,len(TempScore)-1)
  1115. HSScoreM = cint(right(Tempscore,1))
  1116. end If
  1117. PScore5.image = HSArray(HSScore100K):If HSScorex<100000 Then PScore5.image = HSArray(10)
  1118. PScore4.image = HSArray(HSScore10K):If HSScorex<10000 Then PScore4.image = HSArray(10)
  1119. PScore3.image = HSArray(HSScoreK):If HSScorex<1000 Then PScore3.image = HSArray(10)
  1120. PScore2.image = HSArray(HSScore100):If HSScorex<100 Then PScore2.image = HSArray(10)
  1121. PScore1.image = HSArray(HSScore10):If HSScorex<10 Then PScore1.image = HSArray(10)
  1122. PScore0.image = HSArray(HSScore1):If HSScorex<1 Then PScore0.image = HSArray(10)
  1123.  
  1124. ' if showhisc=1 and showhiscnames=1 then
  1125. ' for each objekt in hiscname:objekt.visible=1:next
  1126. HSName1.image = ImgFromCode(HSA1, 1)
  1127. HSName2.image = ImgFromCode(HSA2, 2)
  1128. HSName3.image = ImgFromCode(HSA3, 3)
  1129. ' else
  1130. ' for each objekt in hiscname:objekt.visible=0:next
  1131. ' end if
  1132. End Sub
  1133.  
  1134. Function ImgFromCode(code, digit)
  1135. Dim Image
  1136. if (HighScoreFlashTimer.Enabled = True and hsLetterFlash = 1 and digit = hsCurrentLetter) then
  1137. Image = "postitBL"
  1138. elseif (code + ASC("A") - 1) >= ASC("A") and (code + ASC("A") - 1) <= ASC("Z") then
  1139. Image = "postit" & chr(code + ASC("A") - 1)
  1140. elseif code = 27 Then
  1141. Image = "PostitLT"
  1142. elseif code = 0 Then
  1143. image = "PostitSP"
  1144. Else
  1145. msgbox("Unknown display code: " & code)
  1146. end if
  1147. ImgFromCode = Image
  1148. End Function
  1149.  
  1150. Sub HighScoreEntryInit()
  1151. PlaySound SoundFXDOF("Knocker", 113, DOFPulse, DOFKnocker)
  1152. HSA1=0:HSA2=0:HSA3=0
  1153. HSEnterMode = True
  1154. hsCurrentDigit = 0
  1155. hsCurrentLetter = 1:HSA1=1
  1156. HighScoreFlashTimer.Interval = 250
  1157. HighScoreFlashTimer.Enabled = True
  1158. hsLetterFlash = hsFlashDelay
  1159. End Sub
  1160.  
  1161. Sub HighScoreFlashTimer_Timer()
  1162. hsLetterFlash = hsLetterFlash-1
  1163. UpdatePostIt
  1164. If hsLetterFlash=0 then 'switch back
  1165. hsLetterFlash = hsFlashDelay
  1166. end if
  1167. End Sub
  1168.  
  1169.  
  1170. ' ***********************************************************
  1171. ' HiScore ENTER INITIALS
  1172. ' ***********************************************************
  1173.  
  1174. Sub HighScoreProcessKey(keycode)
  1175. If keycode = LeftFlipperKey Then
  1176. hsLetterFlash = hsFlashDelay
  1177. Select Case hsCurrentLetter
  1178. Case 1:
  1179. HSA1=HSA1-1:If HSA1=-1 Then HSA1=26 'no backspace on 1st digit
  1180. UpdatePostIt
  1181. Case 2:
  1182. HSA2=HSA2-1:If HSA2=-1 Then HSA2=27
  1183. UpdatePostIt
  1184. Case 3:
  1185. HSA3=HSA3-1:If HSA3=-1 Then HSA3=27
  1186. UpdatePostIt
  1187. End Select
  1188. End If
  1189.  
  1190. If keycode = RightFlipperKey Then
  1191. hsLetterFlash = hsFlashDelay
  1192. Select Case hsCurrentLetter
  1193. Case 1:
  1194. HSA1=HSA1+1:If HSA1>26 Then HSA1=0
  1195. UpdatePostIt
  1196. Case 2:
  1197. HSA2=HSA2+1:If HSA2>27 Then HSA2=0
  1198. UpdatePostIt
  1199. Case 3:
  1200. HSA3=HSA3+1:If HSA3>27 Then HSA3=0
  1201. UpdatePostIt
  1202. End Select
  1203. End If
  1204.  
  1205. If (keycode = StartGameKey or keycode = PlungerKey) Then
  1206. Select Case hsCurrentLetter
  1207. Case 1:
  1208. hsCurrentLetter=2 'ok to advance
  1209. HSA2=HSA1 'start at same alphabet spot
  1210. ' EMReelHSName1.SetValue HSA1:EMReelHSName2.SetValue HSA2
  1211. Case 2:
  1212. If HSA2=27 Then 'bksp
  1213. HSA2=0
  1214. hsCurrentLetter=1
  1215. Else
  1216. hsCurrentLetter=3 'enter it
  1217. HSA3=HSA2 'start at same alphabet spot
  1218. End If
  1219. Case 3:
  1220. If HSA3=27 Then 'bksp
  1221. HSA3=0
  1222. hsCurrentLetter=2
  1223. Else
  1224. savehs 'enter it
  1225. HighScoreFlashTimer.Enabled = False
  1226. HSEnterMode = False
  1227. If B2SOn Then Controller.B2SStartAnimation "Attract" 'turn on Attract
  1228. End If
  1229. End Select
  1230. UpdatePostIt
  1231. End If
  1232. End Sub
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
Add Comment
Please, Sign In to add comment