Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '############################################################################################
- '############################################################################################
- '####### ########
- '####### Batman Forever ########
- '####### (Sega 1995) ########
- '####### ########
- '############################################################################################
- '############################################################################################
- 'VP9 Version 1.2 Desktop mfuegemann 2014
- ' Thanks to:
- ' Fuzzel for providing the images for the playfield lights
- ' JPSalas for the Flasher fading code
- 'Crude VPX conversion by DevaL
- Option Explicit
- 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
- Const cgamename = "batmanf"
- '-----------------------------------
- '------ Global Cofigurations ------
- '-----------------------------------
- Const DimGI=-25 'set between -100 and 105 to dim or brighten GI lights (minus is darker)
- Const DimFlashers=0 'set between -255 and 0 to dim or brighten the Flashers (minus is darker)
- Const UseSolenoids=2,UseSync=1
- Const SSolenoidOn="SolOn",SSolenoidOff="SolOff",SFlipperOn="FlipperUp",SFlipperOff="FlipperDown",SCoin="coin3"
- LoadVPM "01560000","DE.VBS",3.1
- '-----------------------------------
- '------ Solenoid Assignment ------
- '-----------------------------------
- SolCallback(1) = "SolTroughBall" 'Trough Lock Ball
- SolCallback(2) = "bsBallRelease.SolOut" 'Trough Up-Kicker
- SolCallback(3) = "Autoplunger" 'Auto Launch
- SolCallback(4) = "SolVUK" 'VUK
- SolCallback(5) = "SolTopEject" 'Top Eject
- '6 - not used
- SolCallback(7) = "DropTargetBank.SolDropUp" 'Drop Target Reset
- SolCallback(8) = "vpmSolSound SoundFX(""knocker"",DOFKnocker)," 'KKnocker
- SolCallback(9) = "bsBallLock.SolOut" 'Bat Cave Ball Lock
- SolCallback(10) = "Sol10" 'Left/Right AB Relay
- SolCallback(11) = "SolGI" 'GI
- SolCallback(12) = "SolRampDiverter" 'Batwing Ramp Diverter
- '13 - not used
- 'SolCallback(14) 'Batwing Motor - handled elsewhere
- SolCallback(15) = "SolFireBWGun" 'Cannon Launch
- SolCallback(16) = "SolBatCaveExit" 'Bat Cave Exit Kicker
- 'SolCallback(17) = "vpmSolSound SoundFX(""Bumper"",DOFContactors)," 'Left Bumper
- 'SolCallback(18) = "vpmSolSound SoundFX(""Bumper"",DOFContactors)," 'Bottom Bumper
- 'SolCallback(19) = "vpmSolSound SoundFX(""Bumper"",DOFContactors)," 'Right Bumper
- 'SolCallback(20) = "vpmSolSound SoundFX(""lSling"",DOFContactors)," 'Left Slingshot
- 'SolCallback(21) = "vpmSolSound SoundFX(""rSling"",DOFContactors)," 'Right Slingshot
- SolCallback(22) = "vpmSolAutoPlunger LaserKick,200," 'Laser Kick
- SolCallback(25) = "SolFlasher1R"
- SolCallback(26) = "SolFlasher2R"
- SolCallback(27) = "SolFlasher3R"
- SolCallback(28) = "SolFlasher4R"
- SolCallback(29) = "SolFlasher5R"
- SolCallback(30) = "SolFlasher6R"
- SolCallback(31) = "SolFlasher7R"
- SolCallback(32) = "SolFlasher8R"
- 'SolCallback(sLRFlipper)="vpmSolFlipper RightFlipper,URightFlipper,"
- 'SolCallback(sLLFlipper)="vpmSolFlipper LeftFlipper,nothing,"
- SolCallback(sLLFlipper) = "SolLFlipper"
- SolCallback(sLRFlipper) = "SolRFlipper"
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("FlipperUp",DOFFlippers)
- LeftFlipper.RotateToEnd
- Else
- PlaySound SoundFX("FlipperDown",DOFFlippers)
- LeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("FlipperUp",DOFFlippers)
- RightFlipper.RotateToEnd
- URightFlipper.RotateToEnd
- Else
- PlaySound SoundFX("FlipperDown",DOFFlippers)
- RightFlipper.RotateToStart
- URightFlipper.RotateToStart
- End If
- End Sub
- Sub SolTroughBall(enabled)
- if enabled then
- bsTrough.ExitSol_On
- bsBallRelease.AddBall 0
- vpmCreateBall BallRelease
- end if
- End Sub
- Sub AutoPlunger(Enabled)
- if enabled then
- Plunger.Kick 0,35+(Rnd*0.9) '34.4-33.5
- Playsound SoundFX("launch",DOFContactors)
- end if
- End Sub
- Dim DiverterUp
- Sub SolRampDiverter(enabled)
- if enabled then
- RampDiverter.collidable = false
- DiverterUp = True
- DiverterTimer.enabled = True
- else
- RampDiverter.collidable = true
- DiverterUp = False
- DiverterTimer.enabled = True
- end if
- end sub
- Sub DiverterTimer_Timer
- if DiverterUp then
- pDiverter.Rotx = pDiverter.Rotx + 4
- if pDiverter.Rotx >= 50 then
- pDiverter.Rotx = 50
- DiverterTimer.enabled = False
- end if
- else
- pDiverter.Rotx = pDiverter.Rotx - 1
- if pDiverter.Rotx <= 3 then
- pDiverter.Rotx = 3
- DiverterTimer.enabled = False
- end if
- end if
- End Sub
- Dim obj,bsTrough,bsTroughKick,bsBallRelease,DropTargetBank,bsBallLock,mBWGun
- '------------------------
- '----- Table Init -----
- '------------------------
- Sub BF_Init
- vpmInit Me
- vpminit me
- On Error Resume Next
- With Controller
- .GameName = cGameName
- If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
- .SplashInfoLine = "Batman Forever (Sega 1995)" & vbNewLine & "created by mfuegemann" & vbNewLine & "crude VPX conversion by DevaL"
- .HandleMechanics=0
- .HandleKeyboard=0
- .ShowDMDOnly=1
- .ShowFrame=0
- .ShowTitle=0
- .hidden = 0
- On Error Resume Next
- .Run GetPlayerHWnd
- If Err Then MsgBox Err.Description
- On Error Goto 0
- End With
- On Error Goto 0
- ' DMD position for 3 Monitor Setup
- 'Controller.Games(cGameName).Settings.Value("dmd_pos_x")=3850
- 'Controller.Games(cGameName).Settings.Value("dmd_pos_y")=300
- 'Controller.Games(cGameName).Settings.Value("dmd_width")=505
- 'Controller.Games(cGameName).Settings.Value("dmd_height")=155
- 'Controller.Games(cGameName).Settings.Value("rol")=0
- PinMAMETimer.Interval = PinMAMEInterval
- PinMAMETimer.Enabled = 1
- vpmNudge.TiltSwitch=1
- vpmNudge.Sensitivity=2
- vpmNudge.TiltObj=Array(Bumper57,Bumper58,Bumper59,LeftSlingshot,RightSlingshot)
- vpmMapLights AllLights
- Set bsTrough = New cvpmBallStack
- bsTrough.InitSw 0,14,13,12,11,0,0,0
- bsTrough.CreateEvents "bsTrough", Drain
- bsTrough.InitAddSnd SSolenoidOn
- bsTrough.InitEntrySnd "drain5", SSolenoidOn
- bsTrough.Balls=4
- set bsBallRelease = New cvpmBallStack
- bsBallRelease.InitSaucer BallRelease, 15, 90, 5
- bsBallRelease.InitExitSnd SoundFX("ballrel",DOFContactors),SoundFX("solenoid",DOFContactors)
- set DropTargetBank = new cvpmDropTarget
- DropTargetBank.InitDrop Array(DropTargetBottom,DropTargetBotMid,DropTargetTopMid,DropTargetTop), Array(18,19,20,21)
- DropTargetBank.InitSnd SoundFX("Targetdrop1",DOFDropTargets),SoundFX("TargetBankreset1",DOFContactors)
- Set bsBallLock = New cvpmBallStack
- bsBallLock.InitSw 0,62,61,60,0,0,0,0
- bsBallLock.InitKick BallLock, 180, 5
- bsBallLock.CreateEvents "bsBallLock", BallLock
- bsBallLock.InitEntrySnd "solenoid", SSolenoidOn
- bsBallLock.Balls=0
- Set mBWGun = New cvpmMech
- mBWGun.MType = vpmMechOneSol + vpmMechReverse + vpmMechNonLinear
- mBWGun.Sol1 = 14
- mBWGun.Length = 500
- mBWGun.Steps = 200
- mBWGun.AddSw 46,0,3
- mBWGun.AddSw 46,197,200
- mBWGun.Callback = GetRef("UpdateBWGun")
- mBWGun.Start
- LaserKick.pullback
- RampDiverter.collidable = true
- DiverterUp = false
- pDiverter.Rotx = 50
- DiverterTimer.enabled = true
- if (DimGI >= -100) and (DimGI <= 105) then
- For each obj in GIString1
- 'obj.Alpha = obj.Alpha + DimGI
- 'obj.isvisible = True
- Next
- For each obj in GIString2
- 'obj.Alpha = obj.Alpha + DimGI
- 'obj.isvisible = True
- Next
- end if
- End Sub
- Sub BF_Exit
- Controller.Stop
- End Sub
- Sub TopEjectKicker_Hit
- Controller.Switch(41) = True
- End Sub
- Sub SolTopEject(Enabled)
- If Enabled Then
- If Controller.Switch(41) = True Then
- PlaySound SoundFX("Kicker",DOFContactors)
- TopEjectKicker.Kick 90,9
- Controller.Switch(41) = False
- end if
- end if
- End Sub
- Sub BatCaveExitKicker_Hit
- Controller.Switch(30) = True
- End Sub
- Sub SolBatCaveExit(Enabled)
- If Enabled Then
- If Controller.Switch(30) = True Then
- PlaySound SoundFX("Kicker",DOFContactors)
- BatCaveExitKicker.Kick 180,45
- Controller.Switch(30) = False
- end if
- end if
- End Sub
- '---------------------------
- '------ GI Handling ------
- '---------------------------
- Sub SolGI(enabled)
- if enabled then
- For each obj in GIString2
- 'obj.isvisible = False
- 'obj.triggersingleupdate
- Next
- else
- For each obj in GIString2
- 'obj.isvisible = True
- 'obj.triggersingleupdate
- Next
- end if
- End Sub
- Sub Sol10(enabled)
- if enabled then
- For each obj in GIString1
- 'obj.isvisible = True
- 'obj.triggersingleupdate
- Next
- else
- For each obj in GIString1
- 'obj.isvisible = False
- 'obj.triggersingleupdate
- Next
- end if
- End Sub
- '--------------------------------
- '------ Flasher Handling ------
- '--------------------------------
- Sub SolFlasher1R(enabled)
- if enabled then
- FLamp1R.state = LightstateOn
- Setflash 6, True
- else
- FLamp1R.state = LightstateOff
- Setflash 6, False
- end if
- End Sub
- Sub SolFlasher2R(enabled)
- if enabled then
- FLamp2Ra.state = LightstateOn
- FLamp2Rb.state = LightstateOn
- Setflash 4, True
- else
- FLamp2Ra.state = LightstateOff
- FLamp2Rb.state = LightstateOff
- Setflash 4, False
- end if
- End Sub
- Sub SolFlasher3R(enabled)
- if enabled then
- Setflash 5, True
- else
- Setflash 5, False
- end if
- End Sub
- Sub SolFlasher4R(enabled)
- if enabled then
- FLamp4R.state = LightstateOn
- Setflash 0, True
- else
- FLamp4R.state = LightstateOff
- Setflash 0, False
- end if
- End Sub
- Sub SolFlasher5R(enabled)
- if enabled then
- Setflash 1, True
- else
- Setflash 1, False
- end if
- End Sub
- Sub SolFlasher6R(enabled)
- if enabled then
- Setflash 2, True
- else
- Setflash 2, False
- end if
- End Sub
- Sub SolFlasher7R(enabled)
- if enabled then
- Setflash 3, True
- else
- Setflash 3, False
- end if
- End Sub
- Sub SolFlasher8R(enabled)
- if enabled then
- FLamp8R.state = LightstateOn
- Setflash 7, True
- else
- FLamp8R.state = LightstateOff
- Setflash 7, False
- end if
- End Sub
- '---------------------------
- '------ Batwing Gun ------
- '---------------------------
- Sub UpdateBWGun(aNewPos, aSpeed, aLastPos)
- if anewpos < 100 then
- pBatwing.rotz = -anewpos / 2
- pBatwingGun.rotz = anewpos / 2
- GunAngle = anewpos / 2
- else
- pBatwing.rotz = (anewpos - 200) / 2
- pBatwingGun.rotz = (200 - anewpos) / 2
- GunAngle = (200 - anewpos) / 2
- end if
- End Sub
- Sub BWGun_Hit
- controller.switch(44) = True
- End Sub
- Dim GunAngle
- Sub SolFireBWGun(Enabled)
- if enabled then
- BWGun.kick GunAngle, 50
- controller.switch(44) = False
- vpmTimer.PulseSw 45
- end if
- End Sub
- '-----------------------------
- '------ VUK animation ------
- '-----------------------------
- Sub VUK_Bottom_Hit
- Controller.Switch(32) = True
- End Sub
- Sub SolVUK(Enabled)
- If Enabled Then
- If Controller.Switch(32) = True Then
- PlaySound SoundFX("Kicker",DOFContactors)
- VUK_Bottom.destroyball
- VUK1.CreateBall
- vpmTimer.AddTimer 70,"VUKLevel1"
- end if
- end if
- end sub
- Sub VUKLevel1(swNo)
- Controller.Switch(32) = False
- VUK1.DestroyBall
- VUK2.CreateBall
- vpmTimer.AddTimer 70,"VUKLevel2"
- End Sub
- Sub VUKLevel2(swNo)
- VUK2.DestroyBall
- VUK3.CreateBall
- vpmTimer.AddTimer 70,"VUKLevel3"
- End Sub
- Sub VUKLevel3(swNo)
- VUK3.DestroyBall
- VUK4.CreateBall
- vpmTimer.AddTimer 70,"VUKLevel4"
- End Sub
- Sub VUKLevel4(swNo)
- VUK4.DestroyBall
- VUK_Top.CreateBall
- VUK_Top.Kick 330,15
- End Sub
- '-------------------------------
- '------ Keybord Handler ------
- '-------------------------------
- Sub BF_KeyDown(ByVal keycode)
- If keycode = LeftFlipperKey Then Controller.Switch(63) = True
- If keycode = RightFlipperKey Then Controller.Switch(64) = True
- If KeyDownHandler(keycode) Then Exit Sub
- If keycode=PlungerKey Then
- Controller.Switch(49) = 1 'Auto Launch
- End if
- End Sub
- Sub BF_KeyUp(ByVal keycode)
- If keycode = LeftFlipperKey Then Controller.Switch(63) = False
- If keycode = RightFlipperKey Then Controller.Switch(64) = False
- If KeyUpHandler(keycode) Then Exit Sub
- If keycode=PlungerKey Then
- Controller.Switch(49) = 0 'Auto Launch
- End if
- End Sub
- '---------------------------------
- '------ Switch Assignment ------
- '---------------------------------
- '1 Tilt - handled elsewhere
- '2 Coin4 - handled elsewhere
- '3 Start - handled elsewhere
- '4 Coin1 - handled elsewhere
- '5 Coin2 - handled elsewhere
- '6 Coin3 - handled elsewhere
- '7 Slam Tilt - handled elsewhere
- '8 Buy In - handled elsewhere
- '9 not used
- '10 not used
- '11 Ball1 - handled elsewhere
- '12 Ball2 - handled elsewhere
- '13 Ball3 - handled elsewhere
- '14 Ball4 - handled elsewhere
- '15 Trough Opto - handled elsewhere
- Sub Trigger16_Hit:Controller.switch(16) = True:end sub '16 Shooter Lane
- Sub Trigger16_Unhit:Controller.switch(16) = False:end sub
- '17 not used
- Sub DropTargetBottom_Hit:vpmTimer.pulseSwitch(18),0,"":End Sub '18 L4Bank Bottom
- Sub DropTargetBotMid_Hit:vpmTimer.pulseSwitch(19),0,"":End Sub '19 L4Bank MidBottom
- Sub DropTargetTopMid_Hit:vpmTimer.pulseSwitch(20),0,"":End Sub '20 L4Bank TopBottom
- Sub DropTargetTop_Hit:vpmTimer.pulseSwitch(21),0,"":End Sub '21 L4Bank Top
- Sub DropTargetBottom_Hit:DropTargetBank.Hit 1:DropTargetBottom.isdropped=true:End Sub '18 and one for the Queen
- Sub DropTargetBotMid_Hit:DropTargetBank.Hit 2:DropTargetBotMid.isdropped=true:End Sub '19
- Sub DropTargetTopMid_Hit:DropTargetBank.Hit 3:DropTargetTopMid.isdropped=true:End Sub '20
- Sub DropTargetTop_Hit:DropTargetBank.Hit 4:DropTargetTop.isdropped=true:End Sub '21
- Sub Trigger22_Hit:Controller.Switch(22)=1:End Sub '22 Top Lane Left
- Sub Trigger22_Unhit:Controller.Switch(22)=0:End Sub
- Sub Trigger23_Hit:Controller.Switch(23)=1:End Sub '23 Top Lane Middle
- Sub Trigger23_Unhit:Controller.Switch(23)=0:End Sub
- Sub Trigger24_Hit:Controller.Switch(24)=1:End Sub '24 Top Lane Right
- Sub Trigger24_Unhit:Controller.Switch(24)=0:End Sub
- Sub TargetRampLeft_Hit:vpmTimer.PulseSw 25:Playsound SoundFX("Target1",DOFTargets):End Sub '25 Left Ramp Left
- Sub TargetRampRight_Hit:vpmTimer.PulseSw 26:Playsound SoundFX("Target1",DOFTargets):End Sub '26 Left Ramp Right
- Sub TargetVUK_Hit:vpmTimer.PulseSw 27:Playsound SoundFX("Target1",DOFTargets):End Sub '27 VUK
- Sub TargetRightRampLeft_Hit:vpmTimer.PulseSw 28:Playsound SoundFX("Target1",DOFTargets):End Sub '28 Right Ramp Left Standup
- Sub TargetRightRampRight_Hit:vpmTimer.PulseSw 29:Playsound SoundFX("Target1",DOFTargets):End Sub '29 Right Ramp Right ?
- '30 Bat Cave Exit Kicker - handled elsewhere
- '31 not used
- '32 VUK - handled elsewhere
- Sub Trigger33_Hit '33 Laser Kick Left Outlane
- vpmTimer.Pulsesw 33
- if Activeball.vely > 0 then
- Activeball.vely = 0.5 * Activeball.vely
- end if
- End Sub
- Sub Trigger33_Unhit:Controller.Switch(33)=0:End Sub
- Sub Trigger34_Hit:Controller.Switch(34)=1:End Sub '34 Left Return Lane
- Sub Trigger34_Unhit:Controller.Switch(34)=0:End Sub
- Sub LeftSlingshot_Slingshot() '35 Left Slingshot
- vpmTimer.pulseSwitch(35),0,""
- PlaySound SoundFX("Bumper",DOFContactors),0,1,-0.15,0.25
- End Sub
- Sub RightSlingshot_Slingshot() '36 Right Slingshot
- vpmTimer.pulseSwitch(36),0,""
- PlaySound SoundFX("Bumper",DOFContactors),0,1,0.15,0.25
- End Sub
- Sub Trigger37_Hit:Controller.Switch(37)=1:End Sub '37 Right Return Lane inside
- Sub Trigger37_Unhit:Controller.Switch(37)=0:End Sub
- Sub Trigger38_Hit:Controller.Switch(38)=1:End Sub '38 Right Return Lane outside
- Sub Trigger38_Unhit:Controller.Switch(38)=0:End Sub
- Sub Trigger39_Hit:Controller.Switch(39)=1:End Sub '39 Right Outlane
- Sub Trigger39_Unhit:Controller.Switch(39)=0:End Sub
- Sub Trigger40_Hit:Controller.Switch(40)=1:End Sub '40 U-Turn Ramp
- Sub Trigger40_Unhit:Controller.Switch(40)=0:End Sub
- '41 Top Eject - handled elsewhere
- Sub TargetTopGood_Hit:vpmTimer.PulseSw 42:Playsound SoundFX("Target1",DOFTargets):End Sub '42 Top Good Head Standup
- Sub TargetTopBad_Hit:vpmTimer.PulseSw 43:Playsound SoundFX("Target1",DOFTargets):End Sub '43 Top Bad Head Standup
- '44 Batwing Loaded - handled elsewhere
- '45 Batwing Location - handled elsewhere
- '46 Batwing Home - handled elsewhere
- Sub Trigger47_Hit:Controller.Switch(47)=1:End Sub '47 Left Orbit
- Sub Trigger47_Unhit:Controller.Switch(47)=0:End Sub
- Sub Trigger48_Hit:Controller.Switch(48)=1:End Sub '48 Right Orbit
- Sub Trigger48_Unhit:Controller.Switch(48)=0:End Sub
- '49 Gun Trigger (Auto Launch) - handled elsewhere
- Sub TargetRightGood_Hit:vpmTimer.PulseSw 50:Playsound SoundFX("Target1",DOFTargets):End Sub '50 Right Good Head Standup
- Sub TargetRightBad_Hit:vpmTimer.PulseSw 51:Playsound SoundFX("Target1",DOFTargets):End Sub '51 Right Bad Head Standup
- Sub Trigger52_Hit:Controller.Switch(52)=1:End Sub '52 Left Ramp Enter
- Sub Trigger52_Unhit:Controller.Switch(52)=0:End Sub
- Sub Trigger53_Hit:Controller.Switch(53)=1:End Sub '53 Left Ramp Exit - Manual is wrong
- Sub Trigger53_Unhit:Controller.Switch(53)=0:End Sub
- Sub Trigger54_Hit:Controller.Switch(54)=1:End Sub '54 Middle Ramp Exit - Manual is wrong
- Sub Trigger54_Unhit:Controller.Switch(54)=0:End Sub
- Sub Trigger55_Hit:Controller.Switch(55)=1:End Sub '55 Right Ramp Enter
- Sub Trigger55_Unhit:Controller.Switch(55)=0:End Sub
- Sub Trigger56_Hit:Controller.Switch(56)=1:End Sub '56 Right Ramp Exit
- Sub Trigger56_Unhit:Controller.Switch(56)=0:End Sub
- Sub Bumper57_Hit() '57 Bumper Left
- vpmTimer.pulseSwitch(57),0,""
- PlaySound SoundFX("Bumper",DOFContactors),0,1,-0.05,0.25
- Bumper57_Dir = -1
- Bumper57.Timerenabled = False
- Bumper57.Timerenabled = True
- End Sub
- Sub Bumper58_Hit() '58 Bumper Bottom
- vpmTimer.pulseSwitch(58),0,""
- PlaySound SoundFX("Bumper",DOFContactors),0,1,0,0.25
- Bumper58_Dir = -1
- Bumper58.Timerenabled = False
- Bumper58.Timerenabled = True
- End Sub
- Sub Bumper59_Hit() '59 Bumper Right
- vpmTimer.pulseSwitch(59),0,""
- PlaySound SoundFX("Bumper",DOFContactors),0,1,0.05,0.25
- Bumper59_Dir = -1
- Bumper59.Timerenabled = False
- Bumper59.Timerenabled = True
- End Sub
- '60 Lock 3 Top - handled elsewhere
- '61 Lock 2 Middle - handled elsewhere
- '62 Lock 1 Bottom - handled elsewhere
- '63 Left Flipper - handled elsewhere
- '64 Upper+Lower Right Flipper - handled elsewhere
- '--------------------------------------------
- 'Helper Functions
- '--------------------------------------------
- 'Bumper animation
- Dim Bumper57_Dir,Bumper58_Dir,Bumper59_Dir
- Sub Bumper57_Timer
- P_BumperRing57.TransZ = P_BumperRing57.TransZ + Bumper57_Dir * 2.5
- if P_BumperRing57.TransZ <= -30 then Bumper57_Dir = 1
- if P_BumperRing57.TransZ >= 0 then
- Bumper57.Timerenabled = False
- Bumper57_Dir = 0
- end if
- End Sub
- Sub Bumper58_Timer
- P_BumperRing58.TransZ = P_BumperRing58.TransZ + Bumper58_Dir * 2.5
- if P_BumperRing58.TransZ <= -30 then Bumper58_Dir = 1
- if P_BumperRing58.TransZ >= 0 then
- Bumper58.Timerenabled = False
- Bumper58_Dir = 0
- end if
- End Sub
- Sub Bumper59_Timer
- P_BumperRing59.TransZ = P_BumperRing59.TransZ + Bumper59_Dir * 2.5
- if P_BumperRing59.TransZ <= -30 then Bumper59_Dir = 1
- if P_BumperRing59.TransZ >= 0 then
- Bumper59.Timerenabled = False
- Bumper59_Dir = 0
- end if
- End Sub
- Sub RampHelper1_Hit
- if Activeball.velz > 1 then Activeball.velz = 0
- if abs(Activeball.velx) > 35 then Activeball.velx = 35 * (Activeball.velx/abs(Activeball.velx))
- if abs(Activeball.vely) > 35 then Activeball.vely = 35 * (Activeball.vely/abs(Activeball.vely))
- End Sub
- Sub RampHelper2_Hit
- Activeball.velz = 0
- End Sub
- Sub RampHelper3_Hit
- Activeball.velz = 0
- if abs(Activeball.velx) > 15 then Activeball.velx = 15 * (Activeball.velx/abs(Activeball.velx))
- if abs(Activeball.vely) > 15 then Activeball.vely = 15 * (Activeball.vely/abs(Activeball.vely))
- End Sub
- Sub RampHelper4_Hit
- Activeball.velz = 0.15 * Activeball.velz
- if abs(Activeball.velx) > 50 then Activeball.velx = 50 * (Activeball.velx/abs(Activeball.velx))
- if abs(Activeball.vely) > 50 then Activeball.vely = 50 * (Activeball.vely/abs(Activeball.vely))
- End Sub
- '---------------------------------------
- '------ JP's Flasher Fading Sub ------
- '---------------------------------------
- Dim Flashers
- Flashers = Array(Flasher4Ra,Flasher5Ra,Flasher6Ra,Flasher7R,Flasher2Ra,Flasher3R,Flasher1R,Flasher8R,Flasher6Rb,Flasher5Rb,Flasher2Rb,Flasher4Ra1,Flasher4Rb,Flasher4Rb1,Flasher5Rb1,Flasher6Rb1,Flasher7R1,Flasher3R1)
- Dim FlashMaxAlpha
- Dim FlashState(200), FlashLevel(200)
- Dim FlashSpeedUp, FlashSpeedDown
- FlashInit()
- FlasherTimer.Interval = 5
- FlasherTimer.Enabled = 1
- Sub FlashInit
- Dim i
- For i = 0 to 200
- FlashState(i) = 0
- FlashLevel(i) = 0
- Next
- FlashSpeedUp = 50 'fast speed when turning on the flasher
- FlashSpeedDown = 10 'slow speed when turning off the flasher, gives a smooth fading
- ' you could also change the default images for each flasher or leave it as in the editor
- ' for example
- ' Flasher1.Image = "fr"
- 'added by mfuegemann to apply Dim settings
- FlashMaxAlpha = 255
- ' if DimFlashers < 0 then
- ' FlashMaxAlpha = FlashMaxAlpha + DimFlashers
- ' if FlashMaxAlpha < 0 then
- ' FlashMaxAlpha = 0
- ' end if
- ' end if
- AllFlashOff()
- End Sub
- Sub AllFlashOff
- Dim i
- For i = 0 to 200
- FlashState(i) = 0
- Next
- End Sub
- dim x
- Sub FlasherTimer_Timer()
- flashm 0, Flasher4Ra1
- flashm 0, Flasher4Rb1
- flashm 0, Flasher4Rb
- flash 0, Flasher4Ra
- flashm 1, Flasher5Rb1
- flashm 1, Flasher5Rb
- flash 1, Flasher5Ra
- flashm 2, Flasher6Rb1
- flashm 2, Flasher6Rb
- flash 2, Flasher6Ra
- flashm 3, Flasher7R1
- flash 3, Flasher7R
- flashm 4, Flasher2Rb
- flash 4, Flasher2Ra
- flashm 5, Flasher3R1
- flash 5, Flasher3R
- flash 6, Flasher1R
- flash 7, Flasher8R
- End Sub
- Sub SetFlash(nr, stat)
- FlashState(nr) = ABS(stat)
- End Sub
- Sub Flash(nr, object)
- Select Case FlashState(nr)
- Case 0 'off
- FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown
- If FlashLevel(nr) < 0 Then
- FlashLevel(nr) = 0
- FlashState(nr) = -1 'completely off
- End if
- 'Object.alpha = FlashLevel(nr)
- Case 1 ' on
- FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp
- If FlashLevel(nr) > FlashMaxAlpha Then '255 original JP code
- FlashLevel(nr) = FlashMaxAlpha '255 original JP code
- FlashState(nr) = -2 'completely on
- End if
- 'Object.alpha = FlashLevel(nr)
- End Select
- End Sub
- Sub Flashm(nr, object) 'multiple flashers, it doesn't change the flashstate
- Select Case FlashState(nr)
- Case 0 'off
- 'Object.alpha = FlashLevel(nr)
- Case 1 ' on
- 'Object.alpha = FlashLevel(nr)
- End Select
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment