Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.74 KB | None | 0 0
  1. 'Flight 2000 (Stern 1980) for VPX by bord
  2. 'lock script courtesy of JP Salas
  3.  
  4. Option Explicit
  5. Randomize
  6.  
  7. Const cGameName = "flight2k"
  8.  
  9. On Error Resume Next
  10. ExecuteGlobal GetTextFile("controller.vbs")
  11. If Err Then MsgBox "Can't open controller.vbs"
  12. On Error Goto 0
  13.  
  14. LoadVPM "01550000", "stern.VBS", 3.26
  15.  
  16. Dim DesktopMode: DesktopMode = table1.ShowDT
  17.  
  18. '************************************************
  19. '************************************************
  20. '************************************************
  21. '************************************************
  22. '************************************************
  23. Const UseSolenoids = 2
  24. Const cSingleLFlip = 0
  25. Const cSingleRFlip = 0
  26. Const UseLamps = True
  27. Const UseGI = False
  28. Const UseSync = False
  29.  
  30. ' Standard Sounds
  31. Const SSolenoidOn = "fx_solenoid"
  32. Const SSolenoidOff = "fx_solenoidoff"
  33. Const SCoin = "fx_coin"
  34.  
  35. Dim bsTrough, dtL, dtR, bump1, bump2, plLane1, plLane2, hiddenvalue
  36.  
  37. If DesktopMode = True Then 'Show Desktop components
  38. CabinetRailLeft.visible=1
  39. CabinetRailRight.visible=1
  40. hiddenvalue=0
  41. Else
  42. CabinetRailLeft.visible=0
  43. CabinetRailRight.visible=0
  44. hiddenvalue=1
  45. End if
  46.  
  47. Sub SolLFlipper(Enabled)
  48. If Enabled Then
  49. PlaySound SoundFX("fx_flipperup",DOFContactors), 0, 1, -0.1, 0.25
  50. LeftFlipper.RotateToEnd
  51. Else
  52. PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 1, -0.1, 0.25
  53. LeftFlipper.RotateToStart
  54. End If
  55. End Sub
  56.  
  57. Sub SolRFlipper(Enabled)
  58. If Enabled Then
  59. PlaySound SoundFX("fx_flipperup",DOFContactors), 0, 1, 0.1, 0.25
  60. RightFlipper.RotateToEnd
  61. Else
  62. PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 1, 0.1, 0.25
  63. RightFlipper.RotateToStart
  64. End If
  65. End Sub
  66.  
  67. Sub FlipperTimer_Timer
  68. 'Add flipper, gate and spinner rotations here
  69. LFLogo1.RotY = LeftFlipper.CurrentAngle
  70. RFLogo1.RotY = RightFlipper.CurrentAngle
  71. End Sub
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. '************************************************
  96. ' Solenoids
  97. '************************************************
  98.  
  99. 'SolCallback(1)
  100. 'SolCallback(2)
  101. 'SolCallback(3)
  102. 'SolCallback(4)
  103. 'SolCallback(5)
  104. 'SolCallback(6)
  105. SolCallback(7) = "SolLeftTargetReset"
  106. SolCallback(8) = "dtL.SolunHit 5,"
  107. SolCallback(9) = "SolBallLock"
  108. SolCallback(10) = "bsTrough.SolOut"
  109. SolCallback(11) = "dtL.SolUnHit 4,"
  110. SolCallback(12) = "dtL.SolUnHit 3,"
  111. SolCallback(13) = "dtL.SolUnHit 1,"
  112. SolCallback(14) = "dtL.SolUnHit 2,"
  113. SolCallback(15) = "SolRightTargetReset"
  114. 'SolCallback(16)
  115. SolCallback(17) = "SolLane2"
  116. 'SolCallback(18)
  117. 'SolCallback(19)
  118. SolCallback(20) = "SolLane1"
  119.  
  120. SolCallback(sLRFlipper) = "SolRFlipper"
  121. SolCallback(sLLFlipper) = "SolLFlipper"
  122.  
  123. Sub Table1_Init
  124. vpmInit Me
  125. With Controller
  126. .GameName = cGameName
  127. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  128. .SplashInfoLine = "Flight 2000 (Stern 1980)"&chr(13)&"by bord"
  129. .HandleKeyboard = 0
  130. .ShowTitle = 0
  131. .ShowDMDOnly = 1
  132. .ShowFrame = 0
  133. .HandleMechanics = False
  134. .Hidden = hiddenvalue
  135. On Error Resume Next
  136. .Run GetPlayerHWnd
  137. If Err Then MsgBox Err.Description
  138. On Error Goto 0
  139. End With
  140.  
  141. PinMAMETimer.Interval = PinMAMEInterval
  142. PinMAMETimer.Enabled = 1
  143.  
  144.  
  145. 'Trough
  146. Set bsTrough=New cvpmBallStack
  147. with bsTrough
  148. .InitSw 0,33,34,35,0,0,0,0
  149. .InitKick BallRelease,90,7
  150. .InitExitSnd Soundfx("fx_ballrel",DOFContactors), Soundfx("fx_solenoid",DOFContactors)
  151. .IsTrough = 1
  152. .Balls=3
  153. end with
  154.  
  155. ' Lane1 Impulse Plunger (by JP Salas)
  156. Const IMPowerSetting = 36 'Plunger Power
  157. Const IMTime = 0.6 ' Time in seconds for Full Plunge
  158. Set plLane1 = New cvpmImpulseP
  159. With plLane1
  160. .InitImpulseP sw15, IMPowerSetting, IMTime
  161. .Random 0.3
  162. .switch 15
  163. .InitExitSnd SoundFX("fx_popper", DOFContactors), SoundFX("fx_popper", DOFContactors)
  164. .CreateEvents "plLane1"
  165. End With
  166.  
  167. ' Lane2 Impulse Plunger (by JP Salas)
  168. Const IMPowerSetting2 = 40 'Plunger Power
  169. Const IMTime2 = 0.6 ' Time in seconds for Full Plunge
  170. Set plLane2 = New cvpmImpulseP
  171. With plLane2
  172. .InitImpulseP sw16, IMPowerSetting2, IMTime2
  173. .Random 0.3
  174. .switch 16
  175. .InitExitSnd SoundFX("fx_popper", DOFContactors), SoundFX("fx_popper", DOFContactors)
  176. .CreateEvents "plLane2"
  177. End With
  178.  
  179. ' Nudging
  180. vpmNudge.TiltSwitch = 7
  181. vpmNudge.Sensitivity = 3
  182. vpmNudge.TiltObj = Array(leftslingshot1, leftslingshot2, rightslingshot1, sw13, sw14)
  183.  
  184. Set dtL=New cvpmDropTarget
  185. dtL.InitDrop Array(sw28,sw29,sw30,sw31,sw32),Array(28,29,30,31,32)
  186. dtL.InitSnd SoundFX("fx2_droptarget",DOFContactors),SoundFX("fx2_DTReset",DOFContactors)
  187.  
  188. Set dtR=New cvpmDropTarget
  189. dtR.InitDrop Array(sw25,sw26,sw27),Array(25,26,27)
  190. dtR.InitSnd SoundFX("fx2_droptarget2",DOFContactors),SoundFX("fx2_DTReset",DOFContactors)
  191.  
  192.  
  193. '*****Drop Lights Off
  194. dim xx
  195.  
  196. For each xx in DTLeftLights: xx.state=0:Next
  197. For each xx in DTRightLights: xx.state=0:Next
  198.  
  199. GILights 1
  200.  
  201. End Sub
  202.  
  203. Sub GILights (enabled)
  204. Dim light
  205. For each light in GI:light.State = Enabled: Next
  206. End Sub
  207.  
  208. Sub Table1_KeyDown(ByVal keycode)
  209. If keycode = LeftTiltKey Then Nudge 90, 2
  210. If keycode = RightTiltKey Then Nudge 270, 2
  211. If keycode = CenterTiltKey Then Nudge 0, 2
  212.  
  213. If vpmKeyDown(keycode) Then Exit Sub
  214. If keycode = PlungerKey Then Plunger.PullBack: PlaySound "fx_plungerpull",0,1,0.25,0.25: End If
  215. End Sub
  216.  
  217. Sub Table1_KeyUp(ByVal keycode)
  218. If keycode = PlungerKey Then Plunger.Fire: PlaySound "fx_plunger",0,1,0.25,0.25
  219. If vpmKeyUp(keycode) Then Exit Sub
  220. End Sub
  221.  
  222. Sub ShooterLane_Hit
  223. End Sub
  224.  
  225. Sub BallRelease_UnHit
  226. End Sub
  227.  
  228. Sub Drain_Hit()
  229. PlaySound "fx2_drain2",0,1,0,0.25 : bstrough.addball me
  230. End Sub
  231.  
  232. '*****************
  233. ' Lock Script Courtesy of JP Salas
  234. '*****************
  235.  
  236. Sub lock3_Hit:Playsound "fx_sensor":Controller.Switch(39) = 1:End Sub
  237.  
  238. Sub SolBallLock(Enabled)
  239. If Enabled Then
  240. Controller.Switch(39) = 0
  241. lock1a.IsDropped = 1:lock2a.IsDropped = 1:lock3a.IsDropped = 1
  242. PlaySound SoundFX("fx_popper",DOFContactors)
  243. lock1.kick 180, 4:lock2.kick 180, 4:lock3.kick 180, 4
  244. Else
  245. lock1a.IsDropped = 0:lock2a.IsDropped = 0:lock3a.IsDropped = 0
  246. End If
  247. End Sub
  248.  
  249. 'Drop Targets
  250. Sub sw28_Dropped:dtL.Hit 1 : End Sub
  251. Sub Sw29_Dropped:dtL.Hit 2 : End Sub
  252. Sub Sw30_Dropped:dtL.Hit 3 : End Sub
  253. Sub Sw31_Dropped:dtL.Hit 4 : GI_Ldrop1.state=1 : End Sub
  254. Sub Sw32_Dropped:dtL.Hit 5 : GI_Ldrop2.state=1 : End Sub
  255.  
  256. Sub Sw25_Dropped:dtR.Hit 1 : GI_Rdrop1_1.state=1 : GI_Rdrop2_1.state=1 : End Sub
  257. Sub Sw26_Dropped:dtR.Hit 2 : GI_Rdrop1_2.state=1 : GI_Rdrop2_2.state=1 : End Sub
  258. Sub Sw27_Dropped:dtR.Hit 3 : GI_Rdrop2_3.state=1 : End Sub
  259.  
  260. Sub SolRightTargetReset(enabled)
  261. dim xx
  262. if enabled then
  263. dtR.SolDropUp enabled
  264. For each xx in DTRightLights: xx.state=0:Next
  265. end if
  266. End Sub
  267.  
  268. Sub SolLeftTargetReset(enabled)
  269. dim xx
  270. if enabled then
  271. dtL.SolDropUp enabled
  272. For each xx in DTLeftLights: xx.state=0:Next
  273. end if
  274. End Sub
  275.  
  276. 'Bumpers
  277.  
  278. Sub sw13_Hit : vpmTimer.PulseSw 13 : playsound SoundFX("fx2_bumper_1",DOFContactors): End Sub
  279. Sub sw14_Hit : vpmTimer.PulseSw 14 : playsound SoundFX("fx2_bumper_1",DOFContactors): End Sub
  280.  
  281. 'Wire Triggers
  282. Sub SW36_Hit:Controller.Switch(36)=1 : End Sub
  283. Sub SW36_unHit:Controller.Switch(36)=0:End Sub
  284. Sub SW17_Hit:Controller.Switch(17)=1 : End Sub
  285. Sub SW17_unHit:Controller.Switch(17)=0:End Sub
  286. Sub SW24_Hit:Controller.Switch(24)=1 : End Sub
  287. Sub SW24_unHit:Controller.Switch(24)=0:End Sub
  288. Sub SW23_Hit:Controller.Switch(23)=1 : End Sub
  289. Sub SW23_unHit:Controller.Switch(23)=0:End Sub
  290. Sub SW22_Hit:Controller.Switch(22)=1 : End Sub
  291. Sub SW22_unHit:Controller.Switch(22)=0:End Sub
  292. Sub SW37_Hit:Controller.Switch(37)=1 : End Sub
  293. Sub SW37_unHit:Controller.Switch(37)=0:End Sub
  294. Sub SW40_Hit:Controller.Switch(40)=1 : End Sub
  295. Sub SW40_unHit:Controller.Switch(40)=0:End Sub
  296. Sub SW18_Hit:Controller.Switch(18)=1 : End Sub
  297. Sub SW18_unHit:Controller.Switch(18)=0:End Sub
  298. Sub SW19_Hit:Controller.Switch(19)=1 : End Sub
  299. Sub SW19_unHit:Controller.Switch(19)=0:End Sub
  300. Sub SW20_Hit:Controller.Switch(20)=1 : End Sub
  301. Sub SW20_unHit:Controller.Switch(20)=0:End Sub
  302. Sub SW21_Hit:Controller.Switch(21)=1 : End Sub
  303. Sub SW21_unHit:Controller.Switch(21)=0:End Sub
  304.  
  305. 'Targets
  306. Sub sw17a_Hit:vpmTimer.PulseSw (17):End Sub
  307. Sub sw17c_Hit:vpmTimer.PulseSw (17):End Sub
  308. Sub sw38_Hit:vpmTimer.PulseSw (38):End Sub
  309.  
  310.  
  311. 'Spinners
  312. Sub sw4_Spin : vpmTimer.PulseSw (4) :PlaySound "fx_spinner": End Sub
  313. Sub sw5_Spin : vpmTimer.PulseSw (5) :PlaySound "fx_spinner": End Sub
  314.  
  315. Sub SolKnocker(Enabled)
  316. If Enabled Then PlaySound SoundFX("Knocker",DOFKnocker)
  317. End Sub
  318.  
  319. '**********Sling Shot Animations
  320. ' Rstep and Lstep are the variables that increment the animation
  321. '****************
  322. Dim RStep1, RStep2, LStep1, RRStep, LUStep, LURStep, RLStep, RLaStep, RLa2Step, R2DropStep, RRRTStep, RRRUStep, RRRLStep
  323.  
  324. Sub RightSlingShot1_Slingshot
  325. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  326. vpmtimer.PulseSw(12)
  327. RSling.Visible = 0
  328. RSling1.Visible = 1
  329. sling1.TransZ = -30
  330. RStep1 = 0
  331. RightSlingShot1.TimerEnabled = 1
  332. End Sub
  333.  
  334. Sub RightSlingShot1_Timer
  335. Select Case RStep1
  336. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  337. Case 4:RSLing2.Visible = 0:RSLing3.Visible = 1:sling1.TransZ = 0
  338. Case 5:RSLing3.Visible = 0:RSLing.Visible = 1:RightSlingShot1.TimerEnabled = 0
  339. End Select
  340. RStep1 = RStep1 + 1
  341. End Sub
  342.  
  343. Sub RightSlingShot2_Slingshot
  344. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  345. vpmtimer.PulseSw(10)
  346. RUSling.Visible = 0
  347. RUSling1.Visible = 1
  348. sling4.TransZ = -30
  349. RStep2 = 0
  350. RightSlingShot2.TimerEnabled = 1
  351. End Sub
  352.  
  353. Sub RightSlingShot2_Timer
  354. Select Case RStep2
  355. Case 3:RUSLing1.Visible = 0:RUSLing2.Visible = 1:sling4.TransZ = -10
  356. Case 4:RUSLing2.Visible = 0:RUSLing3.Visible = 1:sling4.TransZ = 0
  357. Case 5:RUSLing3.Visible = 0:RUSLing.Visible = 1:RightSlingShot2.TimerEnabled = 0
  358. End Select
  359. RStep2 = RStep2 + 1
  360. End Sub
  361.  
  362. Sub RRubberSlingShot_hit
  363. RRubber.Visible = 0
  364. RRubber1.Visible = 1
  365. RRStep = 0
  366. RRubberSlingShot.TimerEnabled = 1
  367. End Sub
  368.  
  369. Sub RRubberSlingShot_Timer
  370. Select Case RRStep
  371. Case 3:RRubber1.Visible = 0:RRubber2.Visible = 1
  372. Case 4:RRubber2.Visible = 0:RRubber.Visible = 1:RRubberSlingShot.TimerEnabled = 0
  373. End Select
  374. RRStep = RRStep + 1
  375. End Sub
  376.  
  377. Sub LeftSlingShot1_Slingshot
  378. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  379. vpmtimer.PulseSw(11)
  380. LSling.Visible = 0
  381. LSling1.Visible = 1
  382. sling2.TransZ = -36
  383. LStep1 = 0
  384. LeftSlingShot1.TimerEnabled = 1
  385. End Sub
  386.  
  387. Sub LeftSlingShot1_Timer
  388. Select Case LStep1
  389. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  390. Case 4:LSLing2.Visible = 0:LSLing3.Visible = 1:sling2.TransZ = 0
  391. Case 5:LSLing3.Visible = 0:LSLing.Visible = 1:LeftSlingShot1.TimerEnabled = 0
  392. End Select
  393. LStep1 = LStep1 + 1
  394. End Sub
  395.  
  396. Sub LeftSlingShot2_Slingshot
  397. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  398. vpmtimer.PulseSw(9)
  399. LUSling.Visible = 0
  400. LUSling1.Visible = 1
  401. sling3.TransZ = -38
  402. LUStep = 0
  403. LeftSlingShot2.TimerEnabled = 1
  404. End Sub
  405.  
  406. Sub LeftSlingShot2_Timer
  407. Select Case LUStep
  408. Case 3:LUSLing1.Visible = 0:LUSLing2.Visible = 1:sling3.TransZ = -10
  409. Case 4:LUSLing2.Visible = 0:LUSLing3.Visible = 1:sling3.TransZ = 0
  410. Case 5:LUSLing3.Visible = 0:LUSLing.Visible = 1:LeftSlingShot2.TimerEnabled = 0
  411. End Select
  412. LUStep = LUStep + 1
  413. End Sub
  414.  
  415. Sub LURubberSling_hit
  416. LUSling.Visible = 0
  417. LUSling4.Visible = 1
  418. LURStep = 0
  419. LURubberSling.TimerEnabled = 1
  420. End Sub
  421.  
  422. Sub LURubberSling_Timer
  423. Select Case LURstep
  424. Case 3:LUSling4.Visible = 0:LUSling5.Visible = 1
  425. Case 4:LUSling5.Visible = 0:LUSling.Visible = 1:LURubberSling.TimerEnabled = 0
  426. End Select
  427. LURStep = LURStep + 1
  428. End Sub
  429.  
  430. Sub RubberLSling_hit
  431. RubberL.Visible = 0
  432. RubberL1.Visible = 1
  433. RLStep = 0
  434. RubberLSling.TimerEnabled = 1
  435. End Sub
  436.  
  437. Sub RubberLSling_Timer
  438. Select Case RLstep
  439. Case 3:RubberL1.Visible = 0:RubberL2.Visible = 1
  440. Case 4:RubberL2.Visible = 0:RubberL.Visible = 1:RubberLSling.TimerEnabled = 0
  441. End Select
  442. RLStep = RLStep + 1
  443. End Sub
  444.  
  445. Sub RubberLaSling_hit
  446. RubberLa.Visible = 0
  447. RubberLa1.Visible = 1
  448. RLaStep = 0
  449. RubberLaSling.TimerEnabled = 1
  450. End Sub
  451.  
  452. Sub RubberLaSling_Timer
  453. Select Case RLastep
  454. Case 3:RubberLa1.Visible = 0:RubberLa2.Visible = 1
  455. Case 4:RubberLa2.Visible = 0:RubberLa.Visible = 1:RubberLaSling.TimerEnabled = 0
  456. End Select
  457. RLaStep = RLaStep + 1
  458. End Sub
  459.  
  460. Sub RubberLaSling1_hit
  461. RubberLa.Visible = 0
  462. RubberLa3.Visible = 1
  463. RLa2Step = 0
  464. RubberLaSling1.TimerEnabled = 1
  465. End Sub
  466.  
  467. Sub RubberLaSling1_Timer
  468. Select Case RLa2step
  469. Case 3:RubberLa3.Visible = 0:RubberLa4.Visible = 1
  470. Case 4:RubberLa4.Visible = 0:RubberLa.Visible = 1:RubberLaSling1.TimerEnabled = 0
  471. End Select
  472. RLa2Step = RLa2Step + 1
  473. End Sub
  474.  
  475. Sub Rubber2DropSling_hit
  476. Rubber2Drop.Visible = 0
  477. Rubber2Drop1.Visible = 1
  478. R2DropStep = 0
  479. Rubber2DropSling.TimerEnabled = 1
  480. End Sub
  481.  
  482. Sub Rubber2DropSling_Timer
  483. Select Case R2Dropstep
  484. Case 3:Rubber2Drop1.Visible = 0:Rubber2Drop2.Visible = 1
  485. Case 4:Rubber2Drop2.Visible = 0:Rubber2Drop3.Visible = 1
  486. Case 5:Rubber2Drop3.Visible = 0:Rubber2Drop.Visible = 1:Rubber2DropSling.TimerEnabled = 0
  487. End Select
  488. R2DropStep = R2DropStep + 1
  489. End Sub
  490.  
  491. Sub RRRTSling_hit
  492. RRRubber.Visible = 0
  493. RRRubber1.Visible = 1
  494. RRRTStep = 0
  495. RRRTSling.TimerEnabled = 1
  496. End Sub
  497.  
  498. Sub RRRTSling_Timer
  499. Select Case RRRTstep
  500. Case 3:RRRubber1.Visible = 0:RRRubber2.Visible = 1
  501. Case 4:RRRubber2.Visible = 0:RRRubber.Visible = 1:RRRTSling.TimerEnabled = 0
  502. End Select
  503. RRRTStep = RRRTStep + 1
  504. End Sub
  505.  
  506. Sub RRRUSling_hit
  507. RRRubber.Visible = 0
  508. RRRubber3.Visible = 1
  509. RRRUStep = 0
  510. RRRUSling.TimerEnabled = 1
  511. End Sub
  512.  
  513. Sub RRRUSling_Timer
  514. Select Case RRRUstep
  515. Case 3:RRRubber3.Visible = 0:RRRubber4.Visible = 1
  516. Case 4:RRRubber4.Visible = 0:RRRubber.Visible = 1:RRRUSling.TimerEnabled = 0
  517. End Select
  518. RRRUStep = RRRUStep + 1
  519. End Sub
  520.  
  521. Sub RRRLSling_hit
  522. RRRubber.Visible = 0
  523. RRRubber5.Visible = 1
  524. RRRLStep = 0
  525. RRRLSling.TimerEnabled = 1
  526. End Sub
  527.  
  528. Sub RRRLSling_Timer
  529. Select Case RRRLstep
  530. Case 3:RRRubber5.Visible = 0:RRRubber6.Visible = 1
  531. Case 4:RRRubber6.Visible = 0:RRRubber.Visible = 1:RRRLSling.TimerEnabled = 0
  532. End Select
  533. RRRLStep = RRRLStep + 1
  534. End Sub
  535.  
  536. 'Kicker Animations (by JP Salas)
  537. Dim sw15Step, sw16Step
  538.  
  539. Sub SolLane1(Enabled)
  540. If Enabled Then
  541. plLane1.AutoFire
  542. sw15Step = 0
  543. Remk2.RotX = 26
  544. sw15t.TimerEnabled = 1
  545. End If
  546. End Sub
  547.  
  548. Sub sw15t_Timer
  549. Select Case sw15Step
  550. Case 1:Remk2.RotX = 14
  551. Case 2:Remk2.RotX = 2
  552. Case 3:Remk2.RotX = -10:sw15t.TimerEnabled = 0
  553. End Select
  554.  
  555. sw15Step = sw15Step + 1
  556. End Sub
  557.  
  558. Sub SolLane2(Enabled)
  559. If Enabled Then
  560. plLane2.AutoFire
  561. sw16Step = 0
  562. Remk1.RotX = 26
  563. sw16t.TimerEnabled = 1
  564. End If
  565. End Sub
  566.  
  567. Sub sw16t_Timer
  568. Select Case sw16Step
  569. Case 1:Remk1.RotX = 14
  570. Case 2:Remk1.RotX = 2
  571. Case 3:Remk1.RotX = -10:sw16t.TimerEnabled = 0
  572. End Select
  573.  
  574. sw16Step = sw16Step + 1
  575. End Sub
  576.  
  577. ' *********************************************************************
  578. ' Supporting Ball & Sound Functions
  579. ' *********************************************************************
  580.  
  581. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  582. Vol = Csng(BallVel(ball) ^2 / 2000)
  583. End Function
  584.  
  585. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  586. Dim tmp
  587. tmp = ball.x * 2 / table1.width-1
  588. If tmp > 0 Then
  589. Pan = Csng(tmp ^10)
  590. Else
  591. Pan = Csng(-((- tmp) ^10) )
  592. End If
  593. End Function
  594.  
  595. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  596. Pitch = BallVel(ball) * 20
  597. End Function
  598.  
  599. Function BallVel(ball) 'Calculates the ball speed
  600. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  601. End Function
  602.  
  603. '*****************************************
  604. ' JP's VP10 Rolling Sounds
  605. '*****************************************
  606.  
  607. Const tnob = 20 ' total number of balls
  608. ReDim rolling(tnob)
  609. InitRolling
  610.  
  611. Sub InitRolling
  612. Dim i
  613. For i = 0 to tnob
  614. rolling(i) = False
  615. Next
  616. End Sub
  617.  
  618. Sub RollingTimer_Timer()
  619. Dim BOT, b
  620. BOT = GetBalls
  621.  
  622. ' stop the sound of deleted balls
  623. For b = UBound(BOT) + 1 to tnob
  624. rolling(b) = False
  625. StopSound("fx_ballrolling" & b)
  626. Next
  627.  
  628. ' exit the sub if no balls on the table
  629. If UBound(BOT) = -1 Then Exit Sub
  630.  
  631. ' play the rolling sound for each ball
  632. For b = 0 to UBound(BOT)
  633. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  634. rolling(b) = True
  635. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  636. Else
  637. If rolling(b) = True Then
  638. StopSound("fx_ballrolling" & b)
  639. rolling(b) = False
  640. End If
  641. End If
  642. Next
  643. End Sub
  644.  
  645. '**********************
  646. ' Ball Collision Sound
  647. '**********************
  648.  
  649. Sub OnBallBallCollision(ball1, ball2, velocity)
  650. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  651. End Sub
  652.  
  653. '******************************
  654. ' Diverse Collection Hit Sounds
  655. '******************************
  656.  
  657. 'Sub aBumpers_Hit (idx): PlaySound SoundFX("fx_bumper", DOFContactors), 0, 1, pan(ActiveBall): End Sub
  658. Sub aRollovers_Hit(idx):PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  659. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  660. Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  661. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  662. Sub aRubbers_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  663. Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  664. Sub aRubber_Pins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  665. Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  666. Sub aTargets_Hit(idx):PlaySound "fx2_target", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  667. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  668.  
  669. '-------------------------------------
  670. ' Map lights into array
  671. ' Set unmapped lamps to Nothing
  672. '-------------------------------------
  673.  
  674. Set Lights(1) = l1
  675. Set Lights(2) = l2
  676. Set Lights(3) = l3
  677. Set Lights(4) = l4
  678. Set Lights(5) = l5
  679. Set Lights(6) = l6
  680. Set Lights(7) = l7
  681. Set Lights(8) = l8
  682. Set Lights(9) = l9
  683. Set Lights(10) = l10
  684. Set Lights(11) = l11
  685. Set Lights(12) = l12
  686. 'Set Lights(13) = l13 High Score to Date
  687. Set Lights(14) = l14
  688. Set Lights(15) = l15
  689. 'Set Lights(16) = l16
  690. Set Lights(17) = l17
  691. Set Lights(18) = l18
  692. Set Lights(19) = l19
  693. Set Lights(20) = l20
  694. Set Lights(21) = l21
  695. Set Lights(22) = l22
  696. Set Lights(23) = l23
  697. Set Lights(24) = l24
  698. Set Lights(25) = l25
  699. Set Lights(26) = l26
  700. Set Lights(27) = l27
  701. Set Lights(28) = l28
  702. Set Lights(29) = l29
  703. Set Lights(30) = l30
  704. Set Lights(31) = l31
  705. 'Set Lights(32) = l32
  706. Set Lights(33) = l33
  707. Set Lights(34) = l34
  708. Set Lights(35) = l35
  709. Set Lights(36) = l36
  710. Set Lights(37) = l37
  711. Set Lights(38) = l38
  712. Set Lights(39) = l39
  713. Set Lights(40) = l40
  714. Set Lights(41) = l41
  715. Set Lights(42) = l42
  716. Set Lights(43) = l43
  717. Set Lights(44) = l44
  718. 'Set Lights(45) = l45 Game Over
  719. Set Lights(46) = l46
  720. 'Set Lights(47) = l47
  721. 'Set Lights(48) = l48
  722. Set Lights(49) = l49
  723. Set Lights(50) = l50
  724. Set Lights(51) = l51
  725. Set Lights(52) = l52
  726. Set Lights(53) = l53
  727. Set Lights(54) = l54
  728. Set Lights(55) = l55
  729. Set Lights(56) = l56
  730. Set Lights(57) = l57
  731. Set Lights(58) = l58
  732. Set Lights(59) = l59
  733. Set Lights(60) = l60
  734. 'Set Lights(61) = l61 TILT
  735. Set Lights(62) = l62
  736. '63 Match
  737. 'Set Lights(64) = l64
  738.  
  739. 'Stern Flight 2000
  740. 'added by Inkochnito
  741. Sub editDips
  742. Dim vpmDips:Set vpmDips = New cvpmDips
  743. With vpmDips
  744. .AddForm 700, 400, "Flight 2000 - DIP switches"
  745. .AddChk 2, 10, 180, Array("Match feature", &H00100000) 'dip 21
  746. .AddChk 2, 25, 115, Array("Credits display", &H00080000) 'dip 20
  747. .AddFrame 2, 45, 190, "Maximum credits", &H00060000, Array("10 credits", 0, "15 credits", &H00020000, "25 credits", &H00040000, "40 credits", &H00060000) 'dip 18&19
  748. .AddFrame 2, 120, 190, "High game to date", 49152, Array("points", 0, "1 free game", &H00004000, "2 free games", 32768, "3 free games", 49152) 'dip 15&16
  749. .AddFrame 2, 195, 190, "High score feature", &H00000020, Array("extra ball", 0, "replay", &H00000020) 'dip 6
  750. .AddFrame 2, 241, 190, "Spot 1 or 2 'F' lites", &H00001000, Array("spot one 'F'", 0, "spot two 'FF'", &H00001000) 'dip 13
  751. .AddFrame 2, 287, 190, "Right spinner lites", &H00200000, Array("start fresh", 0, "retain", &H00200000) 'dip 22
  752. .AddChk 205, 10, 190, Array("Talking sound", &H00010000) 'dip 17
  753. .AddChk 205, 25, 190, Array("Background sound", &H00002000) 'dip 14
  754. .AddFrame 205, 45, 190, "Special award", &HC0000000, Array("no award", 0, "100,000 points", &H40000000, "free ball", &H80000000, "free game", &HC0000000) 'dip 31&32
  755. .AddFrame 205, 120, 190, "Add a ball memory", &H00000090, Array("one ball", 0, "three balls", &H00000010, "five balls", &H00000090) 'dip 5&8
  756. .AddFrame 205, 195, 190, "Balls per game", &H00000040, Array("3 balls", 0, "5 balls", &H00000040) 'dip 7
  757. .AddFrame 205, 241, 190, "Special limit", &H10000000, Array("no limit", 0, "one replay per ball", &H10000000) 'dip 29
  758. .AddFrame 205, 287, 190, "Apollo 1 and 2 lites", &H00800000, Array("are left off at start of the game", 0, "are turned on at start game", &H00800000) 'dip24
  759. .AddFrame 100, 333, 190, "Bonus multiplier", &H20000000, Array("kept in memory", 0, "reset", &H20000000) 'dip30
  760. .AddLabel 50, 385, 300, 20, "After hitting OK, press F3 to reset game with new settings."
  761. .ViewDips
  762. End With
  763. End Sub
  764.  
  765. Sub table1_Paused:Controller.Pause = 1:End Sub
  766. Sub table1_unPaused:Controller.Pause = 0:End Sub
  767. Sub table1_Exit:Controller.Stop:End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement