Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- '~~~ ~~~
- '~~~ Major League ~~~
- '~~~ (PAMCO 1934) ~~~
- '~~~ ~~~
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 'Made by Warbler33 / CactusDude
- 'Released
- 'Version
- ' Very Basic DOF added by Outhere
- ' DOF SETUP
- ' ---------
- '101 - Chime Unit Mid Tone
- '102 - Beacon
- '103 - Shaker
- '104 -
- '105 - 1st Base
- '106 - Chime Unit Low Tone
- '107 - Chime Unit High Tone
- '108 - 2nd Base
- '109 - 3rd Base
- '110 - Topper Bell
- '111 - Flipper Right
- '112 -
- '113 -
- '114 -
- '115 -
- Option Explicit
- On Error Resume Next
- ExecuteGlobal GetTextFile("controller.vbs")
- 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)"
- On Error Goto 0
- Const cGameName = "MajorLeague1934"
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~
- '~~~~~ Configuration ~~~~~
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Const BallsperGame = 10
- Const FreePlay = True
- Const RollingSoundFactor = 2.5 'set sound level factor here for Ball Rolling Sound, 1=default level
- Const VolumeMultiplier = 3 'adjusts table sound volume
- Const EndSound = 1 '1 = "Take Me Out to the Ballgame"; 2 = Chime
- Const BallSize = 20 'Ball radius
- Const BackglassOn = True 'set to false to play without using the backglass
- '(remove/comment out following 4 lines to prevent the backglass from launching)
- Dim Controller
- Set Controller = CreateObject("B2S.Server")
- Controller.B2SName = ""
- Controller.Run
- '***
- Dim i,HighScore,Credits,GameStarted,BallinPlay,BallReleaseLocked,BallsonBoard
- Dim LaneClear
- '--------------------------
- '------ Table Init ------
- '--------------------------
- Sub MajorLeague_Init
- FINISHGAME = False
- LoadHS
- If Hiscore="" then hiscore=300
- Backglasstimer.enabled = true
- Randomize
- if FreePlay then
- Credits = 5
- DOF 126, DOFOn
- end If
- ' TiltKicker.CreateBall
- TiltCount = 0
- BallinPlay = 0
- GameStarted = False
- LaneClear = True
- RBI = 0
- Playerscore = 0
- UsedMarbles = 0
- B2SBall = 0
- If BackglassOn = True then Controller.B2SSetScorePlayer 1, PlayerScore end if
- If BackglassOn = True then Controller.B2SSetScorePlayer 2, RBI end if
- If BackglassOn = True then Controller.B2SSetScorePlayer 3, hiscore end if
- If BackglassOn = True then Controller.B2SSetScorePlayer 4, B2SBall end if
- LoadEM
- End Sub
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~
- '~~~~~ Game Features ~~~~~
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Sub StartGame
- if Credits > 0 Then
- if not GameStarted then
- GameEndTimer.interval = 2000
- BallReleaseLocked = False
- Playerscore = 0
- RBI = 0
- GameStarted = True
- BallinPlay = 0
- UsedMarbles = 0
- B2SBall = 0
- UsedMarbles = 0
- B2SBall = 0
- If BackglassOn = True then Controller.B2SSetScorePlayer 1, PlayerScore end if
- If BackglassOn = True then Controller.B2SSetScorePlayer 2, RBI end if
- If BackglassOn = True then Controller.B2SSetScorePlayer 3, hiscore end if
- If BackglassOn = True then Controller.B2SSetScorePlayer 4, B2SBall end if
- Credits = Credits - 1
- If Credits < 1 Then DOF 126, DOFOff
- if FreePlay and (Credits = 0) then
- Credits = 5
- DOF 126, DOFOn
- end If
- end If
- end If
- End Sub
- Dim B2SBall
- Sub NextBall
- If LaneClear = False then Exit Sub end if
- if BallsonBoard <= BallsperGame Then
- BallReleaseLocked = False
- PlaySound SoundFXDOF("BallLift",111,2,DOFFlippers),0,0.5,Pan(Plunger),0.25,0,0,1,0
- ' BallinPlay = BallinPlay + 1'
- B2SBall = B2SBall + 1
- If BackglassOn = True then Controller.B2SSetScorePlayer 4, B2SBall end if
- end If
- BallRelease.Timerenabled = True
- ' End If
- End Sub
- Sub BallRelease_Timer
- BallRelease.Timerenabled = False
- BallRelease.CreateBall
- BallRelease.Kick 270, 7
- 'DOF 122, DOFPulse
- End Sub
- Sub CheckFinish
- If FINISHGAME = False then Exit Sub end If
- CheckLastBall_Timer
- End Sub
- Sub CheckLastBall_Timer
- If BallsonBoard >= 10 then LastBall.Enabled = True
- End Sub
- Sub LastBall_Timer
- LastBall.Enabled = False
- EndGame
- End Sub
- Sub EndGame
- ' CheckNewHighScorePostIt(Playerscore)
- if PlayerScore>hiscore then hiscore=PlayerScore
- If EndSound = 1 then PlaySound "Take Me Out to the Ballgame" end if
- If EndSound = 2 then PlaySound "Chime" end if
- GameStarted = False
- BallinPlay = 0
- SaveHS
- If BackglassOn = True then Controller.B2SSetScorePlayer 3, hiscore end if
- End Sub
- '--------------------------------
- '------ Helper Functions ------
- '--------------------------------
- Sub SpringWall_Hit
- PlaySound "fx_spinner",0,.25,0,0.25
- WireHook.RotY = 15
- SpringWallMovement.enabled = True
- End Sub
- Sub SpringWallMovement_Timer()
- SpringWall.timerenabled = False
- WireHook.RotY = 10
- End Sub
- Sub Drain_Hit()
- ' PlaySound "drain3",0,0.2,0,0.25
- ' DOF 121, DOFPulse
- Drain.DestroyBall
- End Sub
- Dim BOT2, LBall, FINISHGAME, BallCleared
- Sub LaneEnd_Hit
- BallCleared = True
- End Sub
- Sub EnterPF_Hit
- If BallCleared = True Then
- BallCleared = False
- BallsonBoard = BallsonBoard + 1
- If BallsonBoard = 0 then BallReleaseLocked = False end if
- If BallsonBoard = 1 then BallReleaseLocked = False end if
- If BallsonBoard = 2 then BallReleaseLocked = False end if
- If BallsonBoard = 3 then BallReleaseLocked = False end if
- If BallsonBoard = 4 then BallReleaseLocked = False end if
- If BallsonBoard = 5 then BallReleaseLocked = False end if
- If BallsonBoard = 6 then BallReleaseLocked = False end if
- If BallsonBoard = 7 then BallReleaseLocked = False end if
- If BallsonBoard = 8 then BallReleaseLocked = False end if
- If BallsonBoard = 9 then BallReleaseLocked = False end if
- If BallsonBoard = 10 then BallReleaseLocked = True end if
- Set LBall = ActiveBall
- End If
- End Sub
- Sub CheckMarbles
- If UsedMarbles < 10 then exit sub end If
- If UsedMarbles => 10 then FINISHGAME = True end if
- Checkfinish
- end sub
- Dim BoardDir
- Sub MoveBoardTimer_Timer
- P_Board.Transy = P_Board.Transy + BoardDir
- if P_Board.Transy < -40 Then
- KickerHoleWall.isdropped = True
- Else
- KickerHoleWall.isdropped = False
- End If
- if P_Board.Transy < -57 Then
- BoardDir = -Boarddir
- HoldBoardTimer.enabled = True
- MoveBoardTimer.enabled = False
- end If
- if P_Board.Transy >= 0 Then
- P_Board.Transy = 0
- MoveBoardTimer.enabled = False
- StartGame
- end If
- End Sub
- Sub HoldBoardTimer_Timer
- HoldBoardTimer.enabled = False
- MoveBoardTimer.enabled = True
- PlaySound "BallIn",0,0.75,0,0.25,0,0,1,0
- end Sub
- '-------------------------------
- '------ Keybord Handler ------
- '-------------------------------
- Sub MajorLeague_KeyDown(ByVal keycode)
- If keycode = StartGameKey Then
- if BallsonBoard>9 or BallsonBoard=0 then
- If LastBall.Enabled = False then
- BallsonBoard = 0
- Ballinplay = 0
- BoardDir = -1
- MoveBoardTimer.enabled = True
- PlaySound "CoinTray",0,0.75,0,0.25,0,0,1,0
- PlayerScore=0
- KickerReset
- end if
- end If
- End if
- If keycode = PlungerKey Then
- Plunger.PullBack
- ' PlaySound "plungerpull",0,1,Pan(Plunger),0.25,0,0,1,0
- End If
- If keycode = 48 Then 'B (test)
- PitcherKicker.CreateBall
- End If
- If keycode = 25 then 'P (test)
- PitcherKicker.Kick 180,5
- End If
- If keycode = 31 Then 'S (test)
- SlabKicking
- SlabReset.enabled = true
- HomePlate.Kick 45,20
- FirstBase.Kick -40,20
- SecondBase.Kick -130,20
- ThirdBase.Kick 135,10
- End If
- If keycode = RightFlipperKey or keycode = RightMagnaSave and LaneClear = True then
- if GameStarted and BallReleaseLocked = False Then
- NextBall
- ' PlaySound "ballrelease"
- end If
- End If
- If keycode = LeftTiltKey Then
- Nudge 90, 2
- ' TiltIt
- End If
- If keycode = RightTiltKey Then
- Nudge 270, 2
- ' TiltIt
- End If
- If keycode = CenterTiltKey OR keycode = 57 Then
- Nudge 0, 2
- ' StuckBallSweep
- ' TiltIt
- End If
- End Sub
- Sub MajorLeague_KeyUp(ByVal keycode)
- If keycode = PlungerKey Then
- Plunger.Fire
- PlaySound "PlungerHit",0,1,Pan(Plunger),0.25,0,0,1,0
- End If
- If keycode = LeftFlipperKey Then
- End If
- If keycode = RightFlipperKey Then
- End If
- End Sub
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ' Lane Check
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Sub ShooterLaneLaunch_Hit
- LaneClear = False
- End Sub
- Sub Gate_Hit
- LaneClear = True
- PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- '~~~~~~~~~~~~~~~~~~~~
- ' Tilt (currently not working)
- '~~~~~~~~~~~~~~~~~~~~
- Dim TableTilted
- Dim TiltCount
- 'Dim CheckTilt
- 'Sub TiltIt()
- ' TiltCount = TiltCount + 1
- ' CheckTilt
- 'End sub
- 'Sub CheckTilt
- ' If TiltCount > 4 then TiltKicker.Kick
- 'End sub
- 'Haven't figure out how to get the ball to kick out when you tilt it
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ' Baseball Actions
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 'Primitives
- Sub SlabKicking
- HomeKickSlab.RotY = 120
- FirstKickSlab.RotY = -120
- SecondKickSlab.RotY = -120
- ThirdKickSlab.RotY = 105
- End Sub
- Sub SlabKickingMinusHome
- FirstKickSlab.RotY = -120
- SecondKickSlab.RotY = -120
- ThirdKickSlab.RotY = 105
- End Sub
- Sub SlabReset_Timer()
- SlabReset.enabled = false
- HomeKickSlab.RotY = 90
- FirstKickSlab.RotY = 90
- SecondKickSlab.RotY = 90
- ThirdKickSlab.RotY = 90
- End Sub
- 'Hits
- Sub BatterUpKicker_Hit
- WindUpTimer.enabled = True
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- 'Should all of these require a batter up?
- Sub SingleKicker_Hit
- DOF 105, DOFPulse
- OneBagTimer.enabled = True
- BallinPlay = BallinPlay - 1
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub StolenBaseKicker_Hit
- DOF 101, DOFPulse
- DoingAJobTimer.enabled = True
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub SacHitKicker_Hit
- DOF 201, DOFPulse
- DoingAJobTimer.enabled = True
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub DoubleKicker_Hit
- DOF 108, DOFPulse
- TwoBagTimer.enabled = True
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub TripleKicker_Hit
- DOF 109, DOFPulse
- ThreeBagTimer.enabled = True
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub HomeRunKicker_Hit
- DOF 110, DOFPulse
- TaterTimer.enabled = True
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- 'Timers
- Sub WindUpTimer_Timer()
- WindUpTimer.enabled = False
- PitcherKicker.Kick 180,5
- PitcherKicker.CreateBall
- Playsound "BatterUpFX"
- End Sub
- Sub DoingAJobTimer_Timer()
- DoingAJobTimer.enabled = False
- SlabKickingMinusHome
- SlabReset.enabled = true
- FirstBase.Kick -40,20
- SecondBase.Kick -130,20
- ThirdBase.Kick 135,10
- Playsound "KickersFX"
- End Sub
- Sub OneBagTimer_Timer()
- OneBagTimer.enabled = False
- SlabKicking
- SlabReset.enabled = true
- HomePlate.Kick 45,20
- FirstBase.Kick -40,20
- SecondBase.Kick -130,20
- ThirdBase.Kick 135,10
- Playsound "KickersFX"
- End Sub
- Sub TwoBagTimer_Timer()
- TwoBagTimer.enabled = False
- SlabKicking
- SlabReset.enabled = true
- HomePlate.Kick 45,20
- FirstBase.Kick -40,20
- SecondBase.Kick -130,20
- ThirdBase.Kick 135,10
- OneBagTimer.enabled = True
- Playsound "KickersFX"
- End Sub
- Sub ThreeBagTimer_Timer()
- ThreeBagTimer.enabled = False
- SlabKicking
- SlabReset.enabled = true
- HomePlate.Kick 45,20
- FirstBase.Kick -40,20
- SecondBase.Kick -130,20
- ThirdBase.Kick 135,10
- TwoBagTimer.enabled = True
- Playsound "KickersFX"
- End Sub
- Sub TaterTimer_Timer()
- TaterTimer.enabled = False
- SlabKicking
- SlabReset.enabled = true
- HomePlate.Kick 45,20
- FirstBase.Kick -40,20
- SecondBase.Kick -130,20
- ThirdBase.Kick 135,10
- ThreeBagTimer.enabled = True
- Playsound "KickersFX"
- End Sub
- 'Outs
- Sub LeftFoul_Hit
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub RightFoul_Hit
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ' Scoring / Points
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Dim PlayerScore
- Dim UsedMarbles
- Sub Kick100A_Hit
- DOF 106, DOFPulse
- Addpoints(100)
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub Kick100B_Hit
- DOF 106, DOFPulse
- Addpoints(100)
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub Kick100C_Hit
- DOF 106, DOFPulse
- Addpoints(100)
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub Kick100D_Hit
- DOF 106, DOFPulse
- Addpoints(100)
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub Kick200A_Hit
- DOF 107, DOFPulse
- Addpoints(200)
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub Kick200B_Hit
- DOF 107, DOFPulse
- Addpoints(200)
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub Kick200C_Hit
- DOF 107, DOFPulse
- Addpoints(200)
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Sub Kick200D_Hit
- DOF 107, DOFPulse
- Addpoints(200)
- UsedMarbles = UsedMarbles + 1
- CheckMarbles
- End Sub
- Dim RBI
- Sub RBITrigger_Hit
- Addpoints(3000)
- RBI = RBI + 1
- If BackglassOn = True then Controller.B2SSetScorePlayer 2, RBI end if
- End Sub
- 'On Base
- Sub FirstBase_Hit
- DOF 102, DOFPulse
- Addpoints(200)
- End Sub
- Sub FirstBase_unHit
- Addpoints(-200)
- End Sub
- Sub SecondBase_Hit
- DOF 102, DOFPulse
- Addpoints(500)
- End Sub
- Sub SecondBase_unHit
- Addpoints(-500)
- End Sub
- Sub ThirdBase_Hit
- DOF 103, DOFPulse
- Addpoints(1000)
- End Sub
- Sub ThirdBase_unHit
- Addpoints(-1000)
- End Sub
- 'At end of game, points for balls on base: 1st base = 200, 2nd base = 500, 3rd base = 1,000
- 'It actually tallies this during the game (adds and subtracts as needed on the fly)
- 'I couldn't figure out how to add it at the end, so this works
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ' Kicker Reseting
- '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Sub KickerReset
- Kick100A.DestroyBall
- Kick100B.DestroyBall
- Kick100C.DestroyBall
- Kick100D.DestroyBall
- Kick200A.DestroyBall
- Kick200B.DestroyBall
- Kick200C.DestroyBall
- Kick200D.DestroyBall
- HomePlate.DestroyBall
- FirstBase.DestroyBall
- SecondBase.DestroyBall
- ThirdBase.DestroyBall
- OnDeckCircle.DestroyBall
- PitcherKicker.DestroyBall
- PitcherKicker.CreateBall
- 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 Vol(ball) ' Calculates the Volume of the sound based on the ball speed
- Vol = Csng(BallVel(ball) ^2 / 300) * VolumeMultiplier
- End Function
- Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
- Dim tmp
- tmp = ball.x * 2 / MajorLeague.width-1
- If tmp > 0 Then
- Pan = Csng(tmp ^10)
- Else
- Pan = Csng(-((- tmp) ^10) )
- End If
- 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
- Set LBall = ball
- BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
- if BallVel > 0 then
- GameEndTimer.enabled = False
- end If
- End Function
- 'Function BallVel(LBall)
- 'BallVel = INT(SQR((lball.VelX ^2) + (LBall.VelY ^2) ) )
- 'End Function
- '*****************************************
- ' JP's VP10 Rolling Sounds
- '*****************************************
- Const tnob = 11 ' 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)
- 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 AND BOT(b).z > 30 Then
- rolling(b) = True
- PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
- Else
- If rolling(b) = True Then
- StopSound("fx_ballrolling" & b)
- rolling(b) = False
- End If
- End If
- Next
- End Sub
- '**********************
- ' Ball Collision Sound
- '**********************
- Sub OnBallBallCollision(ball1, ball2, velocity)
- PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
- End Sub
- '******************************************
- ' 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 Pegs_Hit(idx)
- Select Case Int(Rnd*2)+1
- Case 1 : PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 2 : PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- ' Case 3 : PlaySound "Peg4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Select
- End Sub
- Sub Guides_Hit(idx)
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Select
- End Sub
- '---------------------------
- '----- High Score Code -----
- '---------------------------
- Dim hiscore
- sub SaveHS
- savevalue "PAMCOMajorLeague", "hiscore", hiscore
- end sub
- sub LoadHS
- dim temp
- temp = LoadValue("PAMCOMajorLeague", "hiscore")
- If (temp <> "") then hiscore = CDbl(temp)
- end sub
- sub backglasstimer_timer
- backglasstimer.enabled = false
- If BackglassOn = True then Controller.B2SSetScorePlayer 3, hiscore end if
- ' me.enabled=0
- end sub
- Sub Addpoints(ScorePar)
- if GameStarted Then
- Playerscore = Playerscore + ScorePar
- end If
- If BackglassOn = true then Controller.B2SSetScorePlayer 1, Playerscore end if
- End Sub
- '***
- Sub MajorLeague_Exit
- SaveHS
- If B2SOn Then Controller.Stop
- End Sub
Add Comment
Please, Sign In to add comment