Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- option Explicit
- Randomize
- On Error Resume Next
- ExecuteGlobal GetTextFile("controller.vbs")
- If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
- On Error Goto 0
- ' ball size
- 'Const BallSize = 50 ' sets the ball size
- 'Const BallMass = 1.95
- Const cgamename = "uboat65", UseSolenoids=1,UseLamps=0,UseGI=0, SCoin="coin3"
- Const FreePlay = True 'add a coin on StartGame
- Const WatchdogActive = False 'activates the watchdog to correct some ROM issues
- LoadVPM "01560000","nuova.vbs",3.2
- '*************************************************************
- 'Solenoid Call backs
- '**********************************************************************************************************
- SolCallback(3)="vpmSolSound ""knocker"","
- SolCallback(5)="bsTrough.SolOut"
- SolCallback(7)="bsTrough.SolIn" '"SolOuthole"
- SolCallback(14)="SolVUKPopper"
- SolCallback(15)="Sol15" '"bsLeftKicker.SolOut"
- SolCallback(17)="SolMotor"
- SolCallback(19)="Sol19" 'SolGameOn
- SolCallback(20)="SolRamp"
- SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(sLLFlipper) = "SolLFlipper"
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("FlipperUp_Akiles",DOFFlippers):LeftFlipper.RotateToEnd
- Else
- PlaySound SoundFX("FlipperDown_Akiles",DOFFlippers):LeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("FlipperUp_Akiles",DOFFlippers):RightFlipper.RotateToEnd
- Else
- PlaySound SoundFX("FlipperDown_Akiles",DOFFlippers):RightFlipper.RotateToStart
- End If
- End Sub
- '**********************************************************************************************************
- 'Solenoid Controlled toys
- '**********************************************************************************************************
- Sub Sol19(enabled)
- VpmNudge.SolGameOn enabled
- Flipperactive = enabled
- if WatchdogActive then
- if not enabled then
- Sol15(True)
- vpmTimer.AddTimer 1000,"SolVUKPopper(True)'"
- vpmTimer.AddTimer 2500,"Sol15(True)'"
- end if
- end if
- end sub
- Sub Sol15(enabled)
- if WatchdogActive then
- if SW24WatchdogTimer.enabled Then Exit Sub
- if Controller.switch(41) Then Exit Sub
- end if
- if enabled then
- if bsLeftKicker.balls then
- bsLeftKicker.ExitSol_On
- end if
- end if
- end sub
- 'Playfield GI
- '*****GI Lights On
- dim xx
- For each xx in GI:xx.State = 1: Next
- '**********************************************************************************************************
- 'Plunger code
- '**********************************************************************************************************
- Sub Table1_KeyDown(ByVal Keycode)
- If keycode = LeftMagnaSave Then bLutActive = True
- If keycode = RightMagnaSave Then
- If bLutActive Then NextLUT: End If
- End If
- If KeyCode=LeftFlipperKey Then Controller.Switch(12)=1
- If KeyCode=RightFlipperKey Then Controller.Switch(5)=1
- If KeyCode=PlungerKey Then Plunger.Pullback:playsound"plungerpull"
- if FreePlay and keycode = Startgamekey then
- vpmtimer.pulsesw 9
- end if
- If KeyDownHandler(keycode) Then Exit Sub
- End Sub
- Sub Table1_KeyUp(ByVal Keycode)
- If keycode = LeftMagnaSave Then bLutActive = False
- If KeyCode=LeftFlipperKey Then Controller.Switch(12)=0
- If KeyCode=RightFlipperKey Then Controller.Switch(5)=0
- If KeyCode=PlungerKey Then PlaySound"plunger":Plunger.Fire
- If KeyUpHandler(keycode) Then Exit Sub
- End Sub
- ' Movable Ramp
- Dim RampIsDown,RampDir
- Sub SolRamp(enabled)
- if enabled then
- RampIsDown = False
- RampDir = 5
- RampDown.collidable = False
- RampUp.collidable = True
- RampTimer.enabled = True
- if WatchdogActive then
- RampSwitchTimer1.enabled = True
- end if
- Playsound SoundFX("flapopen",DOFContactors),0,0.5,-0.15,0.2
- else
- if WatchdogActive then
- RampSwitchTimer2.enabled = True
- else
- RampIsDown = True
- RampDir = -5
- RampDown.collidable = True
- RampUp.collidable = False
- RampTimer.enabled = True
- Playsound SoundFX("flapclos",DOFContactors),0,0.5,-0.15,0.2
- end if
- end if
- end sub
- Sub RampTimer_Timer
- P_BridgeRamp.rotx = P_BridgeRamp.rotx + RampDir
- P_Ramparm.rotx = P_Ramparm.rotx - (RampDir*2)
- if P_BridgeRamp.rotx < -22 then
- RampTimer.enabled = False
- P_BridgeRamp.rotx = -22
- P_Ramparm.rotx = 40
- end if
- if P_BridgeRamp.rotx > 5 then
- RampTimer.enabled = False
- P_BridgeRamp.rotx = 5
- P_Ramparm.rotx = -15
- end if
- End Sub
- Sub RampSwitchTimer1_Timer
- RampSwitchTimer1.enabled = False
- End Sub
- Sub RampSwitchTimer2_Timer
- if not RampSwitchTimer1.enabled then
- if not controller.solenoid(20) then
- RampSwitchTimer2.enabled = False
- RampIsDown = True
- RampDir = -5
- RampDown.collidable = True
- RampUp.collidable = False
- RampTimer.enabled = True
- Playsound "flapclos",0,0.5,-0.15,0.2
- end if
- end if
- End Sub
- ' Target Bank
- Dim BankIsUp, MotorDir, MotorPos
- MotorPos = 0
- Sub SolMotor(enabled)
- if WatchdogActive then Exit Sub
- if enabled then
- Controller.switch(47) = False
- Controller.switch(48) = False
- if BankIsUp then
- MotorDir = - 1
- else
- MotorDir = 1
- end if
- MotorTimer.enabled = True
- else
- MotorTimer.enabled = False
- if MotorPos < -45 then
- MotorPos = -50
- end if
- if MotorPos > -5 then
- MotorPos = 0
- end if
- end if
- End Sub
- Sub MotorTimer_Timer
- Playsound SoundFX("Motor1",DOFGear),0,1,0.1,0.1
- MotorPos = MotorPos + MotorDir
- if MotorPos > -40 then
- P_TargetCover.collidable = True
- P_TargetCover2.collidable = True
- end if
- if (MotorPos < 0) and (MotorPos > -50) then
- Controller.switch(47) = False
- Controller.switch(48) = False
- END IF
- if (MotorPos <= 0) and (MotorPos >= -50) then
- P_T21.TransZ = MotorPos
- P_T20.TransZ = MotorPos
- P_T19.TransZ = MotorPos
- P_T18.TransZ = MotorPos
- P_T17.TransZ = MotorPos
- P_TargetCover.TransZ = MotorPos
- P_TargetCover2.TransZ = MotorPos
- end if
- if MotorPos >= 0 then
- if WatchdogActive then
- MotorActive = False
- MotorTimer.enabled = False
- if MotorPos < -45 then
- MotorPos = -50
- end if
- if MotorPos > -5 then
- MotorPos = 0
- end if
- end if
- BankIsUp = True
- Controller.switch(47) = False
- Controller.switch(48) = True
- P_T21.TransZ = 0
- P_T20.TransZ = 0
- P_T19.TransZ = 0
- P_T18.TransZ = 0
- P_T17.TransZ = 0
- P_TargetCover.TransZ = 0
- P_TargetCover2.TransZ = 0
- Target17.isdropped = False
- Target18.isdropped = False
- Target19.isdropped = False
- Target20.isdropped = False
- Target21.isdropped = False
- DTRescue.isdropped = False
- if MotorPos > 10 then
- MotorDir = - MotorDir
- end if
- end if
- if MotorPos <= -50 then
- if WatchdogActive then
- MotorActive = False
- MotorTimer.enabled = False
- if MotorPos < -45 then
- MotorPos = -50
- end if
- if MotorPos > -5 then
- MotorPos = 0
- end if
- end if
- BankIsUp = False
- Controller.switch(47) = True
- Controller.switch(48) = False
- P_T21.TransZ = -50
- P_T20.TransZ = -50
- P_T19.TransZ = -50
- P_T18.TransZ = -50
- P_T17.TransZ = -50
- P_TargetCover.TransZ = -50
- P_TargetCover2.TransZ = -50
- Target17.isdropped = True
- Target18.isdropped = True
- Target19.isdropped = True
- Target20.isdropped = True
- Target21.isdropped = True
- P_TargetCover.collidable = False
- P_TargetCover2.collidable = False
- DTRescue.isdropped = True
- if MotorPos < -60 then
- MotorDir = - MotorDir
- End if
- end if
- End Sub
- ' Vuk Popper code from JPSalas
- Dim VUKBall, VUKBallZpos, AnimStarted
- AnimStarted = 0
- Sub SolVUKPopper(Enabled)
- if WatchdogActive then
- if SW24WatchdogTimer.enabled Then Exit Sub
- if Controller.switch(41) Then Exit Sub
- end if
- If AnimStarted Then Exit Sub
- If Enabled Then
- If bsRightVUK.Balls Then
- 'bsRightVUK.ExitSol_On
- AnimStarted = 1
- RightVUK.DestroyBall
- Set VUKBall = RightVUK.Createball
- VUKBallZpos = 25
- RightVUK.TimerInterval = 1
- RightVUK.TimerEnabled = 1
- End If
- End If
- End Sub
- Sub RightVUK_Timer
- VUKBall.Z = VUKBallZpos
- VUKBallZpos = VUKBallZpos + 10
- If VUKBallZpos> 125 Then
- RightVUK.TimerEnabled = 0
- RightVUK.DestroyBall
- bsRightVUK.ExitSol_On
- AnimStarted = 0
- End If
- End Sub
- '--------------------------
- '------ Table Init ------
- '--------------------------
- Dim bsTrough,obj,bsLeftKicker,bsRightVUK,Flipperactive
- Sub Table1_Init
- 'Drain Helper to register balls correctly
- DrainWall1.isdropped = True
- DrainWall2.isdropped = True
- vpminit me
- Controller.GameName=cGameName
- Controller.SplashInfoLine="U-Boat 65" & vbNewLine & "created by mfuegemann"
- Controller.HandleKeyboard=False
- Controller.ShowTitle=0
- Controller.ShowFrame=0
- Controller.ShowDMDOnly=1
- 'Controller.Hidden = 1 'enable to hide DMD if You use a B2S backglass
- Controller.HandleMechanics=0
- Controller.SolMask(0)=0
- vpmTimer.AddTimer 3000,"Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
- Controller.Run
- If Err Then MsgBox Err.Description
- On Error Goto 0
- PinMAMETimer.Interval=PinMAMEInterval
- PinMAMETimer.Enabled = true
- vpmNudge.TiltSwitch=7
- vpmNudge.Sensitivity=5
- vpmNudge.TiltObj = Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot,URightSlingshot)
- 'init Target bank up
- BankIsUp = True
- Controller.switch(47) = False
- Controller.switch(48) = True
- Target17.isdropped = False
- Target18.isdropped = False
- Target19.isdropped = False
- Target20.isdropped = False
- Target21.isdropped = False
- 'init Ramp down
- RampIsDown = True
- ' RampDown.isvisible = RampIsDown
- RampDown.collidable = RampIsDown
- ' RampUp.isvisible = not RampIsDown
- RampUp.collidable = not RampIsDown
- if RampIsDown then
- P_BridgeRamp.rotx = -22
- P_Ramparm.rotx = 40
- else
- P_BridgeRamp.rotx = 5
- P_Ramparm.rotx = -15
- end if
- Set bsTrough=New cvpmBallStack
- bsTrough.InitSw 8,3,2,1,0,0,0,0 '0.1 = Switch 0
- bsTrough.InitKick BallRelease,90,5
- bsTrough.InitExitSnd SoundFX("BallRel",DOFContactors),SoundFX("Solenoid",DOFContactors)
- bsTrough.Balls=3
- Set bsLeftKicker = New cvpmBallStack
- bsLeftKicker.InitExitSnd SoundFX("Popper",DOFContactors),SoundFX("Solenoid",DOFContactors)
- bsLeftKicker.initsaucer LeftKicker,45,0,20
- Set bsRightVUK = New cvpmBallStack
- bsRightVUK.InitExitSnd SoundFX("Popper",DOFContactors),SoundFX("Solenoid",DOFContactors)
- bsRightVUK.initsaucer VUKTop,46,260,20
- End Sub
- '------------------------------
- '------ Trough Handler ------
- '------------------------------
- Sub Drain_Hit()
- 'Ball Drain after 2 balls are locked - the ROM does not recognize the drain if both switches 45 and 46 are ON
- if WatchdogActive then
- DrainWall1.isdropped = False
- DrainWall1.Timerenabled = True
- DrainWall2.isdropped = False
- DrainWall2.Timerenabled = True
- if Controller.Switch(45) and Controller.Switch(46) then
- Controller.Switch(3) = True
- Controller.Switch(2) = True
- Controller.Switch(1) = True
- Controller.Switch(45) = False
- Controller.Switch(46) = False
- BallDrainTimer.enabled = True
- end if
- end if
- SoundTimer.enabled = False
- bsTrough.AddBall Me
- playsound "Drain5"
- End Sub
- '----------------------------
- '------ ROM Watchdog ------
- '----------------------------
- WatchdogTimer.enabled = WatchdogActive
- Dim MotorActive,ActiveBalls
- MotorActive = False
- Sub WatchdogTimer_Timer
- 'Ball Launch after Lock - the ROM sometimes misses to kick the 3rd ball out after ball lock 2
- if Controller.Switch(45) and Controller.Switch(46) and Controller.Switch(3) and not BallDrainTimer.enabled then
- BallLaunchTimer.enabled = True
- end if
- ActiveBalls = 0
- if not controller.switch(1) then
- ActiveBalls = ActiveBalls + 1
- end if
- if not controller.switch(2) then
- ActiveBalls = ActiveBalls + 1
- end if
- if not controller.switch(3) then
- ActiveBalls = ActiveBalls + 1
- end if
- if controller.switch(45) then
- ActiveBalls = ActiveBalls - 1
- end if
- if controller.switch(46) then
- ActiveBalls = ActiveBalls - 1
- end if
- if ActiveBalls = 0 then
- TargetBankUpTimer.enabled = False
- TargetBankDownTimer.enabled = False
- end if
- End Sub
- Sub BallLaunchTimer_Timer
- BallLaunchTimer.enabled = False
- bstrough.ExitSol_On
- End Sub
- Sub BallDrainTimer_Timer
- Controller.Switch(45) = True
- Controller.Switch(46) = True
- Controller.Switch(2) = False
- Controller.Switch(1) = False
- BallDrainTimer.enabled = False
- End Sub
- Sub DrainWall1_Timer
- DrainWall1.Timerenabled = False
- DrainWall1.isdropped = True
- End Sub
- Sub DrainWall2_Timer
- DrainWall2.Timerenabled = False
- DrainWall2.isdropped = True
- DrainWall1.isdropped = False
- DrainWall1.Timerenabled = True
- End Sub
- 'Avoid early VUK kick
- Sub SW24WatchdogTimer_timer
- SW24WatchdogTimer.enabled = False
- End Sub
- 'Avoid moving Target bank on Ball Lock 2
- Sub SW34WatchdogTimer_timer
- SW34WatchdogTimer.enabled = False
- End Sub
- Sub TargetBankUpTimer_Timer
- TargetBankUpTimer.enabled = False
- if BankIsUp then
- MotorDir = - 1
- MotorTimer.enabled = True
- end if
- End Sub
- Dim OnCount,TotalCount
- Sub TargetBankDownTimer_Timer
- TotalCount = Totalcount + 1
- if Controller.lamp(1) and Controller.lamp(1) then
- OnCount = OnCount + 1
- end if
- if TotalCount >= 20 then
- TargetBankDownTimer.enabled = False
- if (not BankIsUp) and (OnCount > 10) then
- MotorDir = 1
- MotorTimer.enabled = True
- end if
- end if
- End Sub
- 'Avoid stuck balls behind lowered ramp
- Sub RampRescue_Hit
- RampRescue.Timerenabled = True
- End Sub
- Sub RampRescue1_Hit
- if RampIsDown and RampRescue.Timerenabled then
- RampRescue.Timerenabled = False
- SolRamp(True)
- vpmTimer.AddTimer 100,"SolRamp(False)'"
- end if
- End Sub
- Sub RampRescue_Timer
- RampRescue.Timerenabled = False
- End Sub
- 'Avoid stuck balls behind raised DT bank
- Sub DTRescue_Hit
- DTRescue.timerenabled = True
- TargetBankUpTimer.enabled = True
- End Sub
- Sub DTRescue_Timer
- DTRescue.timerenabled = False
- End Sub
- '------------------------------
- '------ Switch Handler ------
- '------------------------------
- Sub RightVUK_Hit
- SoundTimer.enabled = False
- Playsound "Gobblehole",0,0.5,0.16,0.1
- bsRightVUK.addball Me
- End Sub
- Sub LeftKicker_Hit
- SoundTimer.enabled = False
- Playsound "Gobblehole",0,0.5,-0.16,0.1
- bsLeftKicker.addball 0
- End Sub
- ' Rollover Switches
- sub LOutlane_hit:Controller.Switch(42)=1:PlaySound "rollover",0,0.1,-0.16,0.1:DOF 101, DOFOn:End Sub
- sub LOutlane_unhit:Controller.Switch(42)=0:DOF 101, DOFOff:End Sub
- sub LInlane_hit:Controller.Switch(44)=1:PlaySound "rollover",0,0.1,-0.15,0.1:End Sub
- sub LInlane_unhit:Controller.Switch(44)=0:End Sub
- sub ROutlane_hit:Controller.Switch(42)=1:PlaySound "rollover",0,0.1,0.16,0.1:DOF 102, DOFOn:End Sub
- sub ROutlane_unhit:Controller.Switch(42)=0:DOF 102, DOFOff:End Sub
- sub RInlane_hit:Controller.Switch(43)=1:PlaySound "rollover",0,0.1,0.15,0.1:End Sub
- sub RInlane_unhit:Controller.Switch(43)=0:End Sub
- sub SW13_hit:Controller.Switch(13)=1:PlaySound "rollover",0,0.1,0,0.1:End Sub
- sub SW13_unhit:Controller.Switch(13)=0:End Sub
- sub SW14_hit:Controller.Switch(14)=1:PlaySound "rollover",0,0.1,-0.05,0.1:End Sub
- sub SW14_unhit:Controller.Switch(14)=0:End Sub
- sub SW15_hit:Controller.Switch(15)=1:PlaySound "rollover",0,0.1,-0.1,0.1:End Sub
- sub SW15_unhit:Controller.Switch(15)=0:End Sub
- sub SW23_hit:Controller.Switch(23)=1:PlaySound "rollover",0,0.1,0.15,0.1:End Sub
- sub SW23_unhit:Controller.Switch(23)=0:End Sub
- sub SW24_hit
- If Watchdogactive then
- SW24WatchdogTimer.enabled = True
- end if
- PlaySound "rollover",0,0.1,-0.12,0.1:
- Controller.Switch(24)=1
- End Sub
- sub SW24_unhit:SW24.timerenabled=True:Controller.Switch(24)=0:End Sub
- sub SW33_hit:Controller.Switch(33)=1:PlaySound "rollover",0,0.1,-0.15,0.1:End Sub
- sub SW33_unhit:Controller.Switch(33)=0:End Sub
- sub SW34_hit
- If Watchdogactive and bsRightVUK.balls then
- SolVUKPopper(True)
- SW34WatchdogTimer.enabled = True
- end if
- PlaySound "rollover",0,0.1,0.15,0.1:
- Controller.Switch(34)=1
- End Sub
- sub SW34_unhit:LOutlane.timerenabled=True:Controller.Switch(34)=0:End Sub
- sub SW41_hit
- PlaySound "rollover",0,0.1,0.18,0.1:
- Controller.Switch(41)=1
- if WatchdogActive then
- Controller.switch(5)=1
- BallLaunchTimer.enabled = False
- end if
- End Sub
- sub SW41_unhit
- Controller.Switch(41)=0
- if WatchdogActive then
- Controller.switch(5)=0
- end if
- End Sub
- ' Targets
- Sub Target4_Hit:vpmTimer.PulseSw 4:PlaySound SoundFX("Target1",DOFTargets),0,1,-0.02,0.1:End Sub
- Sub Target17_Hit:vpmTimer.PulseSw 17:MoveTarget17:PlaySound SoundFX("Target1",DOFTargets),0,1,0.16,0.1:End Sub
- Sub Target18_Hit:vpmTimer.PulseSw 18:MoveTarget18:PlaySound SoundFX("Target1",DOFTargets),0,1,0.14,0.1:End Sub
- Sub Target19_Hit:vpmTimer.PulseSw 19:MoveTarget19:PlaySound SoundFX("Target1",DOFTargets),0,1,0.12,0.1:End Sub
- Sub Target20_Hit:vpmTimer.PulseSw 20:MoveTarget20:PlaySound SoundFX("Target1",DOFTargets),0,1,0.10,0.1:End Sub
- Sub Target21_Hit:vpmTimer.PulseSw 21:MoveTarget21:PlaySound SoundFX("Target1",DOFTargets),0,1,0.08,0.1:End Sub
- Sub Target22_Hit:vpmTimer.PulseSw 22:MoveTarget22:PlaySound SoundFX("Target1",DOFTargets),0,1,0.12,0.1:End Sub
- Sub Target25_Hit:vpmTimer.PulseSw 25:PlaySound SoundFX("Target1",DOFTargets),0,1,0.15,0.1:End Sub
- Sub Target26_Hit:vpmTimer.PulseSw 26:PlaySound SoundFX("Target1",DOFTargets),0,1,0.15,0.1:End Sub
- Sub Target27_Hit:vpmTimer.PulseSw 27:PlaySound SoundFX("Target1",DOFTargets),0,1,0.15,0.1:End Sub
- Sub Target28_Hit:vpmTimer.PulseSw 28:PlaySound SoundFX("Target1",DOFTargets),0,1,0.15,0.1:End Sub
- Sub Target29_Hit:vpmTimer.PulseSw 29:PlaySound SoundFX("Target1",DOFTargets),0,1,0.15,0.1:End Sub
- Sub Target30_Hit:vpmTimer.PulseSw 30:PlaySound SoundFX("Target1",DOFTargets),0,1,-0.15,0.1:End Sub
- Sub Target31_Hit:vpmTimer.PulseSw 31:PlaySound SoundFX("Target1",DOFTargets),0,1,-0.15,0.1:End Sub
- Sub Target32_Hit:vpmTimer.PulseSw 32:PlaySound SoundFX("Target1",DOFTargets),0,1,-0.15,0.1:End Sub
- ' Bumpers
- Sub Bumper1_Hit:vpmTimer.PulseSw 39: PlayBumperSound
- L12.State = 1
- Me.TimerEnabled = 1
- End Sub
- Sub Bumper1_Timer
- L12.State = 0
- Me.Timerenabled = 0
- End Sub
- Sub Bumper2_Hit:vpmTimer.PulseSw 38:PlayBumperSound
- L13.State = 1
- Me.TimerEnabled = 1
- End Sub
- Sub Bumper2_Timer
- L13.State = 0
- Me.Timerenabled = 0
- End Sub
- Sub Bumper3_Hit:vpmTimer.PulseSw 40:PlayBumperSound
- L16.State = 1
- Me.TimerEnabled = 1
- End Sub
- Sub Bumper3_Timer
- L16.State = 0
- Me.Timerenabled = 0
- End Sub
- Sub PlayBumperSound()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound SoundFX("LeftBumper",DOFContactors)
- Case 2 : PlaySound SoundFX("TopBumper",DOFContactors)
- Case 3 : PlaySound SoundFX("RightBumper",DOFContactors)
- End Select
- End Sub
- ' Gates
- Sub Gate1_Hit:PlaySound "Gate5",0,1,0.1,0.1:End Sub
- Sub Gate2_Hit:PlaySound "Gate5",0,1,0.1,0.1:End Sub
- Sub Gate3_Hit:PlaySound "Gate5",0,1,-0.15,0.1:End Sub
- Sub LeftGate_Hit:PlaySound "Gate5",0,1,-0.15,0.1:End Sub
- '**********Sling Shot Animations
- ' Rstep and Lstep are the variables that increment the animation
- '****************
- Dim RStep, Lstep, uRStep
- Sub RightSlingShot_Slingshot
- vpmTimer.PulseSw 36
- PlaySound SoundFX("rSling",DOFContactors), 0,1,0.3,0.1 '0,1, AudioPan(RightSlingShot), 0.05,0,0,1,AudioFade(RightSlingShot)
- RSling.Visible = 0
- RSling1.Visible = 1
- sling1.rotx = 20
- RStep = 0
- RightSlingShot.TimerEnabled = 1
- ' gi1.State = 0:Gi2.State = 0
- End Sub
- Sub RightSlingShot_Timer
- Select Case RStep
- Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.rotx = 10
- Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.rotx = 0:RightSlingShot.TimerEnabled = 0:
- End Select
- RStep = RStep + 1
- End Sub
- Sub LeftSlingShot_Slingshot
- vpmTimer.PulseSw 35
- PlaySound SoundFX("lSling",DOFContactors), 0,1,-0.3,0.1 '0,1, AudioPan(LeftSlingShot), 0.05,0,0,1,AudioFade(LeftSlingShot)
- LSling.Visible = 0
- LSling1.Visible = 1
- sling2.rotx = 20
- LStep = 0
- LeftSlingShot.TimerEnabled = 1
- ' gi3.State = 0:Gi4.State = 0
- End Sub
- Sub LeftSlingShot_Timer
- Select Case LStep
- Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.rotx = 10
- Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.rotx = 0:LeftSlingShot.TimerEnabled = 0:
- End Select
- LStep = LStep + 1
- End Sub
- Sub URightSlingShot_Slingshot
- vpmTimer.PulseSw 37
- PlaySound SoundFX("rSling",DOFContactors), 0,1,0.3,0.1 '0,1, AudioPan(RightSlingShot), 0.05,0,0,1,AudioFade(RightSlingShot)
- URSling.Visible = 0
- URSling1.Visible = 1
- sling3.rotx = 20
- uRStep = 0
- URightSlingShot.TimerEnabled = 1
- ' gi1.State = 0:Gi2.State = 0
- End Sub
- Sub RightSlingShot_Timer
- Select Case uRStep
- Case 3:URSLing1.Visible = 0:URSLing2.Visible = 1:sling3.rotx = 10
- Case 4:URSLing2.Visible = 0:URSLing.Visible = 1:sling3.rotx = 0:URightSlingShot.TimerEnabled = 0:
- End Select
- uRStep = uRStep + 1
- End Sub
- '--------------------------------
- '------ Helper Functions ------
- '--------------------------------
- Sub MoveTarget17
- P_T17.Transy = 5
- Target17.Timerenabled = False
- Target17.Timerenabled = True
- End Sub
- Sub Target17_Timer
- Target17.Timerenabled = False
- P_T17.Transy = 0
- End Sub
- Sub MoveTarget18
- P_T18.Transy = 5
- Target18.Timerenabled = False
- Target18.Timerenabled = True
- End Sub
- Sub Target18_Timer
- Target18.Timerenabled = False
- P_T18.Transy = 0
- End Sub
- Sub MoveTarget19
- P_T19.Transy = 5
- Target19.Timerenabled = False
- Target19.Timerenabled = True
- End Sub
- Sub Target19_Timer
- Target19.Timerenabled = False
- P_T19.Transy = 0
- End Sub
- Sub MoveTarget20
- P_T20.Transy = 5
- Target20.Timerenabled = False
- Target20.Timerenabled = True
- End Sub
- Sub Target20_Timer
- Target20.Timerenabled = False
- P_T20.Transy = 0
- End Sub
- Sub MoveTarget21
- P_T21.Transy = 5
- Target21.Timerenabled = False
- Target21.Timerenabled = True
- End Sub
- Sub Target21_Timer
- Target21.Timerenabled = False
- P_T21.Transy = 0
- End Sub
- Sub MoveTarget22
- P_T22.Transy = 5
- Target22.Timerenabled = False
- Target22.Timerenabled = True
- End Sub
- Sub Target22_Timer
- Target22.Timerenabled = False
- P_T22.Transy = 0
- End Sub
- 'additional Lamp Callback
- Sub LampTimer_Timer
- if WatchdogActive and not DTRescue.timerenabled then
- 'Move Bank up if all lights are ON
- if Controller.Lamp(2)<>0 and (Controller.Lamp(49)<>0 or Controller.Lamp(33)<>0 or Controller.Lamp(17)<>0 or Controller.Lamp(13)<>0) then
- if (not BankisUp) and (not TargetBankDownTimer.enabled) then
- OnCount = 0
- TotalCount = 0
- TargetBankDownTimer.enabled = True
- end if
- end if
- 'Move Bank down if all lights are OFF
- if Controller.Lamp(2)=0 and Controller.Lamp(49)=0 and Controller.Lamp(33)=0 and Controller.Lamp(17)=0 and Controller.Lamp(13)=0 then
- TargetBankUpTimer.enabled = True
- end if
- if Controller.Lamp(17)<>0 or Controller.Lamp(13)<>0 then
- TargetBankUpTimer.enabled = False
- end if
- end if
- End sub
- '***************************************************
- ' JP's VP10 Fading Lamps & Flashers
- ' Based on PD's Fading Light System
- ' SetLamp 0 is Off
- ' SetLamp 1 is On
- ' fading for non opacity objects is 4 steps
- '***************************************************
- Dim LampState(200), FadingLevel(200)
- Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
- InitLamps() ' turn off the lights and flashers and reset them to the default parameters
- LampTimer.Interval = 5 'lamp fading speed
- LampTimer.Enabled = 1
- ' Lamp & Flasher Timers
- Sub LampTimer_Timer()
- Dim chgLamp, num, chg, ii
- chgLamp = Controller.ChangedLamps
- If Not IsEmpty(chgLamp) Then
- For ii = 0 To UBound(chgLamp)
- LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
- FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
- Next
- End If
- UpdateLamps
- End Sub
- Sub UpdateLamps()
- NFadeL 1, l1
- NFadeL 2, l2
- NFadeL 3, l3
- NFadeL 4, l4
- NFadeL 5, l5
- NFadeL 6, l6
- NFadeL 7, L7
- NFadeL 8, l8
- NFadeL 9, l9
- NFadeL 10, l10
- NFadeL 11, L11
- NFadeLm 14, l14 'Flasher
- NFadeL 14, l14a 'Flasher
- NFadeLm 15, l15 'Flasher
- NFadeL 15, l15a 'Flasher
- NFadeL 17, l17
- NFadeL 18, l18
- NFadeL 19, l19
- NFadeL 20, l20
- NFadeL 21, l21
- NFadeL 22, l22
- NFadeL 23, l23
- NFadeL 24, l24
- NFadeL 25, l25
- NFadeL 26, l26
- NFadeL 27, l27
- NFadeLm 31, l31
- NFadeL 31, l31a 'Flasher
- NFadeL 33, l33
- NFadeL 34, l34
- NFadeL 35, l35
- NFadeL 36, l36
- NFadeL 37, l37
- NFadeL 38, l38
- NFadeL 39, l39
- NFadeL 40, l40
- NFadeL 41, l41
- NFadeLm 42, l42
- NFadeLm 42, l42a
- NFadeL 42, l42b
- NFadeL 43, l43
- NFadeL 44, l44
- NFadeLm 46, l46 'Flasher
- NFadeL 46, l46a 'Flasher
- NFadeL 49, l49
- NFadeL 50, l50
- NFadeL 51, l51
- NFadeL 52, l52
- NFadeL 53, l53
- NFadeL 54, l54
- NFadeL 55, l55
- NFadeL 56, l56
- NFadeL 57, l57
- NFadeL 58, l58
- NFadeLm 59, l59
- NFadeLm 59, l59a
- NFadeL 59, l59b 'Apron Light
- NFadeL 60, l60
- NFadeLm 62, l62 'Flasher
- NFadeL 62, l62a 'Flasher
- 'Solenid Controlled Lamps
- End Sub
- ' div lamp subs
- Sub InitLamps()
- Dim x
- For x = 0 to 200
- LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
- FadingLevel(x) = 4 ' used to track the fading state
- FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
- FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
- FlashMax(x) = 1 ' the maximum value when on, usually 1
- FlashMin(x) = 0 ' the minimum value when off, usually 0
- FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
- Next
- End Sub
- Sub AllLampsOff
- Dim x
- For x = 0 to 200
- SetLamp x, 0
- Next
- End Sub
- Sub SetLamp(nr, value)
- If value <> LampState(nr) Then
- LampState(nr) = abs(value)
- FadingLevel(nr) = abs(value) + 4
- End If
- End Sub
- ' Lights: used for VP10 standard lights, the fading is handled by VP itself
- Sub NFadeL(nr, object)
- Select Case FadingLevel(nr)
- Case 4:object.state = 0:FadingLevel(nr) = 0
- Case 5:object.state = 1:FadingLevel(nr) = 1
- End Select
- End Sub
- Sub NFadeLm(nr, object) ' used for multiple lights
- Select Case FadingLevel(nr)
- Case 4:object.state = 0
- Case 5:object.state = 1
- End Select
- End Sub
- 'Lights, Ramps & Primitives used as 4 step fading lights
- 'a,b,c,d are the images used from on to off
- Sub FadeObj(nr, object, a, b, c, d)
- Select Case FadingLevel(nr)
- Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
- Case 5:object.image = a:FadingLevel(nr) = 1 'ON
- Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
- Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 13:object.image = d:FadingLevel(nr) = 0 'Off
- End Select
- End Sub
- Sub FadeObjm(nr, object, a, b, c, d)
- Select Case FadingLevel(nr)
- Case 4:object.image = b
- Case 5:object.image = a
- Case 9:object.image = c
- Case 13:object.image = d
- End Select
- End Sub
- Sub NFadeObj(nr, object, a, b)
- Select Case FadingLevel(nr)
- Case 4:object.image = b:FadingLevel(nr) = 0 'off
- Case 5:object.image = a:FadingLevel(nr) = 1 'on
- End Select
- End Sub
- Sub NFadeObjm(nr, object, a, b)
- Select Case FadingLevel(nr)
- Case 4:object.image = b
- Case 5:object.image = a
- End Select
- End Sub
- ' Flasher objects
- Sub Flash(nr, object)
- Select Case FadingLevel(nr)
- Case 4 'off
- FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
- If FlashLevel(nr) < FlashMin(nr) Then
- FlashLevel(nr) = FlashMin(nr)
- FadingLevel(nr) = 0 'completely off
- End if
- Object.IntensityScale = FlashLevel(nr)
- Case 5 ' on
- FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
- If FlashLevel(nr) > FlashMax(nr) Then
- FlashLevel(nr) = FlashMax(nr)
- FadingLevel(nr) = 1 'completely on
- End if
- Object.IntensityScale = FlashLevel(nr)
- End Select
- End Sub
- Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
- Object.IntensityScale = FlashLevel(nr)
- End Sub
- '-------------------------------
- '------ DIP Switch Menu ------
- '-------------------------------
- Sub editDips
- Dim vpmDips:Set vpmDips=New cvpmDips
- With vpmDips
- .AddForm 200,250,"U-Boat 65 DIP switches"
- .AddFrame 5, 0,170,"Balls per game",&HC0000000,Array("2 balls",&HC0000000,"3 balls",0,"4 balls",&H80000000,"5 balls",&H40000000) '31+32
- .AddFrame 5,80,170,"Max. credits",&H03000000,Array("10",0,"15",&H01000000,"25",&H02000000,"40",&H03000000) '25+26
- .AddChk 5,160,170,Array("Match feature",&H08000000) '28
- .AddChk 5,180,170,Array("Autopercentage",&H20000000) '30
- .AddChk 5,200,170,Array("Only one Special per game",&H10000000) '29
- .AddFrame 210,0,170,"Extra Ball lights",&H04000000,Array("Alternating",0,"Always on",&H04000000) '27
- .AddChk 210,55,170,Array("Memory Multiplicator",32768) '8
- .AddChk 210,75,170,Array("Memory Bonus Ramp",&H00000040) '7
- .AddChk 210,95,170,Array("Memory Outhole Bonus",&H00000020) '6
- .AddChk 210,115,170,Array("Memory 250/500K Mines",&H00004000) '15
- .AddChk 210,135,170,Array("Memory Mines",&H00002000) '14
- .AddChk 210,155,170,Array("Memory A-B-C",&H00800000) '24
- .AddChk 210,175,170,Array("Memory Target Bank",&H00200000) '22
- .AddChk 210,195,170,Array("Memory Ships",&H00100000) '21
- .AddLabel 0,230,280,20,"After hitting OK, press F3 to reset game with new settings."
- .ViewDips
- End With
- End Sub
- Set vpmShowDips=GetRef("editDips")
- '*************
- ' JP'S LUT
- '*************
- Dim bLutActive, LUTImage
- Sub LoadLUT
- Dim x
- x = LoadValue(cGameName, "LUTImage")
- If(x <> "") Then LUTImage = x Else LUTImage = 0
- UpdateLUT
- End Sub
- Sub SaveLUT
- SaveValue cGameName, "LUTImage", LUTImage
- End Sub
- Sub NextLUT: LUTImage = (LUTImage +1 ) MOD 10: UpdateLUT: SaveLUT: End Sub
- Sub UpdateLUT
- Select Case LutImage
- Case 0: table1.ColorGradeImage = "LUT0"
- Case 1: table1.ColorGradeImage = "LUT1"
- Case 2: table1.ColorGradeImage = "LUT2"
- Case 3: table1.ColorGradeImage = "LUT3"
- Case 4: table1.ColorGradeImage = "LUT4"
- Case 5: table1.ColorGradeImage = "LUT5"
- Case 6: table1.ColorGradeImage = "LUT6"
- Case 7: table1.ColorGradeImage = "LUT7"
- Case 8: table1.ColorGradeImage = "LUT8"
- Case 9: table1.ColorGradeImage = "LUT9"
- End Select
- End Sub
- '*********************************************************************
- ' Positional Sound Playback Functions
- '*********************************************************************
- ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
- ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
- ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
- Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
- PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
- End Sub
- ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
- Sub PlaySoundAt(soundname, tableobj)
- PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
- End Sub
- Sub PlaySoundAtBall(soundname)
- PlaySoundAt soundname, ActiveBall
- End Sub
- '*********************************************************************
- ' Supporting Ball & Sound Functions
- '*********************************************************************
- 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
- Dim tmp
- tmp = tableobj.y * 2 / table1.height-1
- If tmp > 0 Then
- AudioFade = Csng(tmp ^10)
- Else
- AudioFade = Csng(-((- tmp) ^10) )
- End If
- End Function
- Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
- Dim tmp
- tmp = tableobj.x * 2 / table1.width-1
- If tmp > 0 Then
- AudioPan = Csng(tmp ^10)
- Else
- AudioPan = Csng(-((- tmp) ^10) )
- End If
- End Function
- Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
- Vol = Csng(BallVel(ball) ^2 / 2000)
- End Function
- Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
- Pitch = BallVel(ball) * 20
- End Function
- Function BallVel(ball) 'Calculates the ball speed
- BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
- End Function
- '********************************************************************
- ' JP's VP10 Rolling Sounds (+rothbauerw's Dropping Sounds)
- '********************************************************************
- Const tnob = 5 ' total number of balls
- ReDim rolling(tnob)
- InitRolling
- Sub InitRolling
- Dim i
- For i = 0 to tnob
- rolling(i) = False
- Next
- End Sub
- Sub RollingTimer_Timer()
- Dim BOT, b
- BOT = GetBalls
- ' stop the sound of deleted balls
- For b = UBound(BOT) + 1 to tnob
- rolling(b) = False
- StopSound "fx_ballrolling" & b
- StopSound "fx_plasticrolling" & b
- StopSound "fx_metalrolling" & b
- Next
- ' exit the sub if no balls on the table
- If UBound(BOT) = -1 Then Exit Sub
- ' play the rolling sound for each ball
- For b = 0 to UBound(BOT)
- If BallVel(BOT(b) ) > 1 Then
- rolling(b) = True
- If BOT(b).Z > 30 Then
- ' ball on plastic ramp
- StopSound "fx_ballrolling" & b
- StopSound "fx_metalrolling" & b
- PlaySound "fx_plasticrolling" & b, -1, Vol(BOT(b)) / 2, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
- Else
- ' ball on playfield
- StopSound "fx_plasticrolling" & b
- StopSound "fx_metalrolling" & b
- PlaySound "fx_ballrolling" & b, -1, Vol(BOT(b)) / 2, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
- End If
- Else
- If rolling(b) Then
- StopSound "fx_ballrolling" & b
- StopSound "fx_plasticrolling" & b
- StopSound "fx_metalrolling" & b
- rolling(b) = False
- End If
- End If
- ' ball drop sounds matching the adjusted height params but not the way down the ramps
- If BOT(b).VelZ < -1 And BOT(b).Z < 55 And BOT(b).Z > 27 then 'And Not InRect(BOT(b).X, BOT(b).Y, 610,320, 740,320, 740,550, 610,550) And Not InRect(BOT(b).X, BOT(b).Y, 180,400, 230,400, 230, 550, 180,550) Then
- PlaySound "fx_ball_drop" & Int(Rnd()*3), 0, ABS(BOT(b).VelZ)/17*5, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
- End If
- Next
- End Sub
- '**********************
- ' Ball Collision Sound
- '**********************
- Sub OnBallBallCollision(ball1, ball2, velocity)
- PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
- End Sub
- '*****************************************
- ' ninuzzu's FLIPPER SHADOWS
- '*****************************************
- sub FlipperTimer_Timer()
- pleftFlipper.objrotz=leftFlipper.CurrentAngle
- prightFlipper.objrotz=rightFlipper.CurrentAngle
- FlipperLSh.RotZ = LeftFlipper.currentangle
- FlipperRSh.RotZ = RightFlipper.currentangle
- End Sub
- '*****************************************
- ' ninuzzu's BALL SHADOW
- '*****************************************
- Dim BallShadow
- BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
- Sub BallShadowUpdate_timer()
- Dim BOT, b
- BOT = GetBalls
- ' hide shadow of deleted balls
- If UBound(BOT)<(tnob-1) Then
- For b = (UBound(BOT) + 1) to (tnob-1)
- BallShadow(b).visible = 0
- Next
- End If
- ' exit the Sub if no balls on the table
- If UBound(BOT) = -1 Then Exit Sub
- ' render the shadow for each ball
- For b = 0 to UBound(BOT)
- If BOT(b).X < Table1.Width/2 Then
- BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 6
- Else
- BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 6
- End If
- ballShadow(b).Y = BOT(b).Y + 12
- If BOT(b).Z > 20 Then
- BallShadow(b).visible = 1
- Else
- BallShadow(b).visible = 0
- End If
- Next
- End Sub
- '************************************
- ' What you need to add to your table
- '************************************
- ' a timer called RollingTimer. With a fast interval, like 10
- ' one collision sound, in this script is called fx_collide
- ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
- ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
- '******************************************
- ' Explanation of the rolling sound routine
- '******************************************
- ' sounds are played based on the ball speed and position
- ' the routine checks first for deleted balls and stops the rolling sound.
- ' The For loop goes through all the balls on the table and checks for the ball speed and
- ' if the ball is on the table (height lower than 30) then then it plays the sound
- ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
- ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
- ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
- ' according to the position of the ball on the table.
- '**************************************
- ' Explanation of the collision routine
- '**************************************
- ' The collision is built in VP.
- ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
- ' 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
- ' depending of the speed of the collision.
- Sub Pins_Hit (idx)
- PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
- End Sub
- Sub Targets_Hit (idx)
- PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
- End Sub
- Sub Metals_Thin_Hit (idx)
- PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Sub
- Sub Metals_Medium_Hit (idx)
- PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Sub
- Sub Metals2_Hit (idx)
- PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Sub
- Sub Gates_Hit (idx)
- PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Sub
- Sub Spinner_Spin
- PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
- End Sub
- Sub Rubbers_Hit(idx)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 20 then
- PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End if
- If finalspeed >= 6 AND finalspeed <= 20 then
- RandomSoundRubber()
- End If
- End Sub
- Sub Posts_Hit(idx)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 16 then
- PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End if
- If finalspeed >= 6 AND finalspeed <= 16 then
- RandomSoundRubber()
- End If
- End Sub
- Sub RandomSoundRubber()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Select
- End Sub
- Sub LeftFlipper_Collide(parm)
- RandomSoundFlipper()
- End Sub
- Sub RightFlipper_Collide(parm)
- RandomSoundFlipper()
- End Sub
- Sub RandomSoundFlipper()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Select
- End Sub
- Sub Table1_Exit()
- If B2SOn Then
- Controller.Pause = False
- Controller.Stop
- End If
- End Sub
Add Comment
Please, Sign In to add comment