Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '*****************************************************************************************************
- ' CREDITS
- ' Initial table created by fuzzel, jimmyfingers, jpsalas, toxie & unclewilly (in alphabetical order)
- ' Flipper primitives by zany
- ' Ball rolling sound script by jpsalas
- ' Ball shadow by ninuzzu
- ' Ball control by rothbauerw
- ' DOF by arngrim
- ' Positional sound helper functions by djrobx
- ' Plus a lot of input from the whole community (sorry if we forgot you :/)
- '*****************************************************************************************************
- Option Explicit
- Randomize
- 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
- LoadVPM "01550000", "stern.vbs", 3.36
- Dim cCredits,Objekt,bsTrough,bsSaucer,bsSaucerL,bsSaucerR,dtL,dtR
- cCredits="Flight 2000" & vbNewline & "Stern 1980"
- Const cGameName = "flight2k"
- Const UseSolenoids = 1
- Const UseLamps = 1
- Const UseGI = 0
- Const UseSync = 0
- Const HandleMech = 0
- Const SSolenoidOn = "solon"
- Const SSolenoidOff = "soloff"
- Const SCoin = "Coin"
- Set vpmShowDips = GetRef("editDips")
- SolCallback(7) = "dtL.SolDropUp"
- SolCallback(8) = "dtL.SolUnHit 5,"
- SolCallback(9) = "SolBallLock"
- SolCallback(10) = "bsTrough.SolOut"
- SolCallback(11) = "dtL.SolUnHit 4,"
- SolCallback(12) = "dtL.SolUnHit 3,"
- SolCallback(13) = "dtL.SolUnHit 1,"
- SolCallback(14) = "dtL.SolUnHit 2,"
- SolCallback(15) = "dtR.SolDropUp"
- SolCallback(17) = "bsSaucerR.SolOut"
- SolCallback(20) = "bsSaucerL.SolOut"
- SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(sLLFlipper) = "SolLFlipper"
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("fx_Flipperup",DOFFlippers):LeftFlipper.RotateToEnd
- Else
- PlaySound SoundFX("fx_Flipperdown",DOFFlippers):LeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("fx_Flipperup",DOFFlippers):RightFlipper.RotateToEnd
- Else
- PlaySound SoundFX("fx_Flipperdown",DOFFlippers):RightFlipper.RotateToStart
- End If
- End Sub
- Sub Table1_Init
- On Error Resume Next
- With Controller
- .GameName=cGameName
- If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description:Exit Sub
- .SplashInfoLine=cCredits
- .HandleMechanics=0
- .ShowDMDOnly=1
- .ShowFrame=0
- .ShowTitle=0
- .Hidden=0
- .Run
- If Err Then MsgBox Err.Description
- End With
- On Error Goto 0
- Set bsTrough = New cvpmBallStack
- With bsTrough
- .InitSw 0, 33, 34, 35, 0, 0, 0, 0
- .InitKick BallRelease, 80, 6
- .InitEntrySnd "drain", "Solenoid"
- .InitExitSnd SoundFX("Ballrel",DOFContactors), SoundFX("Solenoid",DOFContactors)
- .Balls = 3
- End With
- Set bsSaucerL = New cvpmBallStack
- With bsSaucerL
- .InitSaucer Kicker1, 15, 0, 25
- .InitExitSnd SoundFX("popper_ball",DOFContactors), SoundFX("popper",DOFContactors)
- .kickforcevar = 4
- End With
- Set bsSaucerR = New cvpmBallStack
- With bsSaucerR
- .InitSaucer Kicker2, 16, 0, 25
- .InitExitSnd SoundFX("popper_ball",DOFContactors), SoundFX("popper",DOFContactors)
- .kickforcevar = 4
- End With
- Set dtL = New cvpmDropTarget
- With dtL
- .InitDrop Array(Target1,Target2,Target3,Target4,Target5), Array(28, 29, 30, 31, 32)
- .InitSnd SoundFX("target",DOFTargets), SoundFX("fx_resetdrop",DOFDropTargets)
- End With
- Set dtR = New cvpmDropTarget
- With dtR
- .InitDrop Array(Target6,Target7,Target8), Array(25, 26, 27)
- .InitSnd SoundFX("target",DOFTargets), SoundFX("fx_resetdrop",DOFDropTargets)
- End With
- vpmNudge.TiltSwitch = 7
- vpmNudge.Sensitivity = 1
- vpmNudge.TiltObj = Array(Bumper1, Bumper2, LeftSlingshot, RightSlingshot, LeftSlingShot1, RightSlingShot1)
- PinmameTimer.Interval = PinMameInterval
- PinmameTimer.Enabled = 1
- vpmMapLights aLights
- If Table1.ShowDT = False then
- for each objekt in backdropstuff:objekt.visible = False:Next
- End If
- End Sub
- Sub table1_Paused:Controller.Pause = 1:End Sub
- Sub table1_unPaused:Controller.Pause = 0:End Sub
- '*******************************************
- ' Ball Lock Maze
- '*******************************************
- Sub TopTrigger_Hit:vpmTimer.PulseSw(39):Playsound "sensor":End Sub
- Sub SolBallLock(Enabled):
- If Enabled Then
- PostDelay.Enabled=1
- MiddlePost.RotX = 90:MiddlePost.collidable = False
- BottomPost.RotX = 90:BottomPost.collidable = False
- '
- Else
- TopPost.RotX = 0:TopPost.collidable = True
- MiddlePost.RotX = 0:MiddlePost.collidable = True
- BottomPost.RotX = 0:BottomPost.collidable = True
- End If
- End Sub
- Sub PostDelay_Timer
- TopPost.RotX = 90:TopPost.collidable = False
- TopPost.RotX = 0:TopPost.collidable = False
- MiddlePost.RotX = 0:MiddlePost.collidable = True
- BottomPost.RotX = 0:BottomPost.collidable = True
- PostDelay.Enabled=0
- End Sub
- '***************************
- 'Switches
- '***************************
- Sub Trigger2_Hit:Controller.Switch(18)=1:End Sub
- Sub Trigger2_unHit:Controller.Switch(18)=0:End Sub
- Sub Trigger3_Hit:Controller.Switch(19)=1:End Sub
- Sub Trigger3_unHit:Controller.Switch(19)=0:End Sub
- Sub Trigger4_Hit:Controller.Switch(20)=1:End Sub
- Sub Trigger4_unHit:Controller.Switch(20)=0:End Sub
- Sub Trigger5_Hit:Controller.Switch(21)=1:End Sub
- Sub Trigger5_unHit:Controller.Switch(21)=0:End Sub
- Sub Trigger6_Hit:Controller.Switch(40)=1:End Sub
- Sub Trigger6_unHit:Controller.Switch(40)=0:End Sub
- Sub LeftInlane_Hit:Controller.Switch(23)=1:End Sub
- Sub LeftInlane_unHit:Controller.Switch(23)=0:End Sub
- Sub RightInlane_Hit:Controller.Switch(24)=1:End Sub
- Sub RightInlane_unHit:Controller.Switch(24)=0:End Sub
- Sub LeftInlane1_Hit:Controller.Switch(17)=1:DOF 101, DOFOn:End Sub
- Sub LeftInlane1_unHit:Controller.Switch(17)=0:DOF 101, DOFOff:End Sub
- Sub RightInlane1_Hit:Controller.Switch(22)=1:End Sub
- Sub RightInlane1_unHit:Controller.Switch(22)=0:End Sub
- Sub LeftOutlane_Hit:Controller.Switch(36)=1:End Sub
- Sub LeftOutLane_unHit:Controller.Switch(36)=0:End Sub
- Sub RightOutlane_Hit:Controller.Switch(37)=1:End Sub
- Sub RightOutlane_unHit:Controller.Switch(37)=0:End Sub
- Sub Target9_Hit:vpmTimer.PulseSw(17):DOF 102, DOFPulse:End Sub
- Sub Target10_Hit:vpmTimer.PulseSw(38):End Sub
- Sub Target11_Hit:vpmTimer.PulseSw(17):DOF 103, DOFPulse:End Sub
- Sub Spinner1_Spin():vpmTimer.PulseSw(4):PlaySound "fx_spinner", 0, .25, AudioPan(Spinner1), 0.25, 0, 0, 1, AudioFade(Spinner1):End Sub
- Sub Spinner2_Spin():vpmTimer.PulseSw(5):PlaySound "fx_spinner", 0, .25, AudioPan(Spinner2), 0.25, 0, 0, 1, AudioFade(Spinner2):End Sub
- Sub Bumper1_Hit():vpmTimer.PulseSw(13):RandomSoundBumper:End Sub
- Sub Bumper2_Hit():vpmTimer.PulseSw(14):RandomSoundBumper:End Sub
- Sub Target1_Hit:dtL.Hit 1:End Sub
- Sub Target2_Hit:dtL.Hit 2:End Sub
- Sub Target3_Hit:dtL.Hit 3:End Sub
- Sub Target4_Hit:dtL.Hit 4:End Sub
- Sub Target5_Hit:dtL.Hit 5:End Sub
- Sub Target6_Hit:dtR.Hit 1:End Sub
- Sub Target7_Hit:dtR.Hit 2:End Sub
- Sub Target8_Hit:dtR.Hit 3:End Sub
- Sub Kicker1_Hit:bsSaucerL.AddBall 0:End Sub
- Sub Kicker2_Hit:bsSaucerR.AddBall 0:End Sub
- Sub Drain_Hit:bsTrough.addball me : playsound "drain" : End Sub
- Dim EnableBallControl
- EnableBallControl = false 'Change to true to enable manual ball control (or press C in-game) via the arrow keys and B (boost movement) keys
- BallSize = 50
- '****************
- 'Enhanced lighting
- '****************
- Sub lighttimer_Timer
- If Target6.isdropped then
- SpecialLight1.state=1
- GI10.state=0
- Else
- SpecialLight1.state=0
- GI10.state=1
- End If
- If Target7.isdropped then
- SpecialLight2.state=1
- Else
- SpecialLight2.state=0
- End If
- If Target8.isdropped then
- SpecialLight3.state=1
- GI11.state=0
- Else
- SpecialLight3.state=0
- GI11.state=1
- End If
- End Sub
- Sub Table1_KeyDown(ByVal KeyCode)
- If keycode = PlungerKey Then
- Plunger.PullBack
- PlaySound "plungerpull",0,1,AudioPan(Plunger),0.25,0,0,1,AudioFade(Plunger)
- End If
- If vpmKeyDown(KeyCode) Then Exit Sub
- ' Manual Ball Control
- If keycode = 46 Then ' C Key
- If EnableBallControl = 1 Then
- EnableBallControl = 0
- Else
- EnableBallControl = 1
- End If
- End If
- If EnableBallControl = 1 Then
- If keycode = 48 Then ' B Key
- If BCboost = 1 Then
- BCboost = BCboostmulti
- Else
- BCboost = 1
- End If
- End If
- If keycode = 203 Then BCleft = 1 ' Left Arrow
- If keycode = 200 Then BCup = 1 ' Up Arrow
- If keycode = 208 Then BCdown = 1 ' Down Arrow
- If keycode = 205 Then BCright = 1 ' Right Arrow
- End If
- End Sub
- Sub Table1_KeyUp(ByVal keycode)
- If keycode = PlungerKey Then
- Plunger.Fire
- PlaySound "plunger",0,1,AudioPan(Plunger),0.25,0,0,1,AudioFade(Plunger)
- End If
- If vpmKeyUp(KeyCode) Then Exit Sub
- 'Manual Ball Control
- If EnableBallControl = 1 Then
- If keycode = 203 Then BCleft = 0 ' Left Arrow
- If keycode = 200 Then BCup = 0 ' Up Arrow
- If keycode = 208 Then BCdown = 0 ' Down Arrow
- If keycode = 205 Then BCright = 0 ' Right Arrow
- End If
- End Sub
- '*****GI Lights On
- dim xx
- For each xx in GI:xx.State = 1: Next
- '**********Sling Shot Animations
- ' Rstep and Lstep are the variables that increment the animation
- '****************
- Dim RStep,RStep1,LStep,LStep1
- Sub RightSlingShot_Slingshot
- vpmTimer.PulseSw(12)
- PlaySound SoundFX("right_slingshot",DOFContactors), 0,1, 0.05,0.05
- RSling.Visible = 0
- RSling1.Visible = 1
- sling1.TransZ = -20
- RStep = 0
- RightSlingShot.TimerEnabled = 1
- End Sub
- Sub RightSlingShot_Timer
- Select Case RStep
- Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
- Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
- End Select
- RStep = RStep + 1
- End Sub
- Sub RightSlingShot1_Slingshot
- vpmTimer.PulseSw(10)
- PlaySound SoundFX("right_slingshot",DOFContactors), 0,1, 0.05,0.05
- RSling5.Visible = 0
- RSling4.Visible = 1
- sling3.TransZ = -20
- RStep1 = 0
- RightSlingShot1.TimerEnabled = 1
- End Sub
- Sub RightSlingShot1_Timer
- Select Case RStep1
- Case 3:RSLing4.Visible = 0:RSLing3.Visible = 1:sling3.TransZ = -10
- Case 4:RSLing3.Visible = 0:RSLing5.Visible = 1:sling3.TransZ = 0:RightSlingShot1.TimerEnabled = 0
- End Select
- RStep1 = RStep1 + 1
- End Sub
- Sub LeftSlingShot_Slingshot
- vpmTimer.PulseSw(11)
- PlaySound SoundFX("left_slingshot",DOFContactors), 0,1, -0.05,0.05
- LSling.Visible = 0
- LSling1.Visible = 1
- sling2.TransZ = -20
- LStep = 0
- LeftSlingShot.TimerEnabled = 1
- End Sub
- Sub LeftSlingShot_Timer
- Select Case LStep
- Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
- Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
- End Select
- LStep = LStep + 1
- End Sub
- Sub LeftSlingShot1_Slingshot
- vpmTimer.PulseSw(9)
- PlaySound SoundFX("left_slingshot",DOFContactors), 0,1, -0.05,0.05
- LSling5.Visible = 0
- LSling4.Visible = 1
- sling4.TransZ = -20
- LStep1 = 0
- LeftSlingShot1.TimerEnabled = 1
- End Sub
- Sub LeftSlingShot1_Timer
- Select Case LStep1
- Case 3:LSLing4.Visible = 0:LSLing3.Visible = 1:sling4.TransZ = -10
- Case 4:LSLing3.Visible = 0:LSLing5.Visible = 1:sling4.TransZ = 0:LeftSlingShot1.TimerEnabled = 0
- End Select
- LStep1 = LStep1 + 1
- 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
- '*****************************************
- ' rothbauerw's Manual Ball Control
- '*****************************************
- Dim BCup, BCdown, BCleft, BCright
- Dim ControlBallInPlay, ControlActiveBall
- Dim BCvel, BCyveloffset, BCboostmulti, BCboost
- BCboost = 1 'Do Not Change - default setting
- BCvel = 4 'Controls the speed of the ball movement
- BCyveloffset = -0.01 'Offsets the force of gravity to keep the ball from drifting vertically on the table, should be negative
- BCboostmulti = 3 'Boost multiplier to ball veloctiy (toggled with the B key)
- ControlBallInPlay = false
- Sub StartBallControl_Hit()
- Set ControlActiveBall = ActiveBall
- ControlBallInPlay = true
- End Sub
- Sub StopBallControl_Hit()
- ControlBallInPlay = false
- End Sub
- Sub BallControlTimer_Timer()
- If EnableBallControl and ControlBallInPlay then
- If BCright = 1 Then
- ControlActiveBall.velx = BCvel*BCboost
- ElseIf BCleft = 1 Then
- ControlActiveBall.velx = -BCvel*BCboost
- Else
- ControlActiveBall.velx = 0
- End If
- If BCup = 1 Then
- ControlActiveBall.vely = -BCvel*BCboost
- ElseIf BCdown = 1 Then
- ControlActiveBall.vely = BCvel*BCboost
- Else
- ControlActiveBall.vely = bcyveloffset
- End If
- End If
- End Sub
- '*****************************************
- ' JP's VP10 Rolling 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)
- 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)), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
- 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, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
- End Sub
- '*****************************************
- ' ninuzzu's FLIPPER SHADOWS (Spinners added)
- '*****************************************
- sub FlipperTimer_Timer()
- FlipperLSh.RotZ = LeftFlipper.currentangle
- FlipperRSh.RotZ = RightFlipper.currentangle
- Spinner1Shadow.RotZ = Spinner1.currentangle
- Spinner2Shadow.RotZ = Spinner2.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 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 RandomSoundBumper()
- Select Case Int(Rnd*4)+1
- Case 1 : PlaySound SoundFX("fx_bumper1",DOFContactors), 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 2 : PlaySound SoundFX("fx_bumper2",DOFContactors), 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 3 : PlaySound SoundFX("fx_bumper3",DOFContactors), 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 4 : PlaySound SoundFX("fx_bumper4",DOFContactors), 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Select
- End Sub
- 'Stern Flight 2000
- 'added by Inkochnito
- Sub editDips
- Dim vpmDips:Set vpmDips = New cvpmDips
- With vpmDips
- .AddForm 700, 400, "Flight 2000 - DIP switches"
- .AddChk 2, 10, 180, Array("Match feature", &H00100000) 'dip 21
- .AddChk 2, 25, 115, Array("Credits display", &H00080000) 'dip 20
- .AddFrame 2, 45, 190, "Maximum credits", &H00060000, Array("10 credits", 0, "15 credits", &H00020000, "25 credits", &H00040000, "40 credits", &H00060000) 'dip 18&19
- .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
- .AddFrame 2, 195, 190, "High score feature", &H00000020, Array("extra ball", 0, "replay", &H00000020) 'dip 6
- .AddFrame 2, 241, 190, "Spot 1 or 2 'F' lites", &H00001000, Array("spot one 'F'", 0, "spot two 'FF'", &H00001000) 'dip 13
- .AddFrame 2, 287, 190, "Right spinner lites", &H00200000, Array("start fresh", 0, "retain", &H00200000) 'dip 22
- .AddChk 205, 10, 190, Array("Talking sound", &H00010000) 'dip 17
- .AddChk 205, 25, 190, Array("Background sound", &H00002000) 'dip 14
- .AddFrame 205, 45, 190, "Special award", &HC0000000, Array("no award", 0, "100,000 points", &H40000000, "free ball", &H80000000, "free game", &HC0000000) 'dip 31&32
- .AddFrame 205, 120, 190, "Add a ball memory", &H00000090, Array("one ball", 0, "three balls", &H00000010, "five balls", &H00000090) 'dip 5&8
- .AddFrame 205, 195, 190, "Balls per game", &H00000040, Array("3 balls", 0, "5 balls", &H00000040) 'dip 7
- .AddFrame 205, 241, 190, "Special limit", &H10000000, Array("no limit", 0, "one replay per ball", &H10000000) 'dip 29
- .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
- .AddFrame 100, 333, 190, "Bonus multiplier", &H20000000, Array("kept in memory", 0, "reset", &H20000000) 'dip30
- .AddLabel 50, 385, 300, 20, "After hitting OK, press F3 to reset game with new settings."
- .ViewDips
- End With
- End Sub
- '************************************
- ' LEDs Display
- 'Based on Scapino's 7 digit Reel LEDs
- '************************************
- Dim Digits(32)
- Dim Patterns(11)
- Dim Patterns2(11)
- Patterns(0) = 0 'empty
- Patterns(1) = 63 '0
- Patterns(2) = 6 '1
- Patterns(3) = 91 '2
- Patterns(4) = 79 '3
- Patterns(5) = 102 '4
- Patterns(6) = 109 '5
- Patterns(7) = 125 '6
- Patterns(8) = 7 '7
- Patterns(9) = 127 '8
- Patterns(10) = 111 '9
- Patterns2(0) = 128 'empty
- Patterns2(1) = 191 '0
- Patterns2(2) = 134 '1
- Patterns2(3) = 219 '2
- Patterns2(4) = 207 '3
- Patterns2(5) = 230 '4
- Patterns2(6) = 237 '5
- Patterns2(7) = 253 '6
- Patterns2(8) = 135 '7
- Patterns2(9) = 255 '8
- Patterns2(10) = 239 '9
- Set Digits(0) = a0
- Set Digits(1) = a1
- Set Digits(2) = a2
- Set Digits(3) = a3
- Set Digits(4) = a4
- Set Digits(5) = a5
- Set Digits(6) = a6
- Set Digits(7) = b0
- Set Digits(8) = b1
- Set Digits(9) = b2
- Set Digits(10) = b3
- Set Digits(11) = b4
- Set Digits(12) = b5
- Set Digits(13) = b6
- Set Digits(14) = c0
- Set Digits(15) = c1
- Set Digits(16) = c2
- Set Digits(17) = c3
- Set Digits(18) = c4
- Set Digits(19) = c5
- Set Digits(20) = c6
- Set Digits(21) = d0
- Set Digits(22) = d1
- Set Digits(23) = d2
- Set Digits(24) = d3
- Set Digits(25) = d4
- Set Digits(26) = d5
- Set Digits(27) = d6
- Set Digits(28) = e0
- Set Digits(29) = e1
- Set Digits(30) = e2
- Set Digits(31) = e3
- Sub LED_Timer
- On Error Resume Next
- Dim ChgLED, ii, jj, chg, stat
- ChgLED = Controller.ChangedLEDs(&HFF, &HFFFF)
- If Not IsEmpty(ChgLED) Then
- For ii = 0 To UBound(ChgLED)
- chg = chgLED(ii, 1):stat = chgLED(ii, 2)
- For jj = 0 to 10
- If stat = Patterns(jj) OR stat = Patterns2(jj) then Digits(chgLED(ii, 0) ).SetValue jj
- Next
- Next
- End IF
- End Sub
- Sub Trigger1_Timer()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment