-
Notifications
You must be signed in to change notification settings - Fork 31
/
Splatterhouse (Original 2023) 1.52.vbs
4149 lines (3143 loc) · 102 KB
/
Splatterhouse (Original 2023) 1.52.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
' Splatterhouse
Option Explicit
Dim Controller
Dim FlexDMD
Const UseFlexDMD = 1
Dim Score
Sub AddScore(points) 'we also need to Dim Score in the beginning of script. all Variables should go in the beginning of script.
Score = Score + points ' This adds your score + the points in the (Brackets) when something is hit & it contains AddScore(#)
ScoreText.Text = FormatNumber(Score, 0, -1, 0, -1) 'this Displays the points added in scoretext.Text box on the backdrop
ScoreR1.SetValue Score
End Sub
Sub AddPoints(Points)
Score(CurrentPlayer) = Score(CurrentPlayer) + Points
scorereel1.addvalue(points)
End Sub
Sub Timer12_Timer
ScoreText.Text = FormatNumber(Score, 0, -1, 0, -1) 'this Displays the points added in scoretext.Text box on the backdrop
ScoreR1.SetValue Score
Timer12.Enabled = True
End Sub
' Randomize
turnoffrules = 0 ' change to 1 to take off the backglass helper rules text during a game
turnonultradmd = 0 ' change to 1 to turn on ultradmd
toppervideo = 0 'set to 1 to turn on the topper
ballrolleron = 1 ' set to 0 to turn off the ball roller if you use the "c" key in your cabinet
Const typefont = "Raleway Medium"
Const numberfont = "Bebas Neue"
Const zoomfont = "Fundamental Brigade"
Const zoombgfont = "Fundamental 3D Brigade" ' needs to be an outline of the zoomfont
Const cGameName = "demo"
Const TableName = "demo"
Const myVersion = "75"
'Constructions
Const BallSize = 50
Const MaxPlayers = 1
Const BallSaverTime = 15
Const MaxMultiplier = 6
Const MaxMultiballs = 5
Const bpgcurrent = 3
Const Balls = 5
' Define Global Variables
Dim toppervideo
Dim ballrolleron
Dim turnonultradmd
Dim turnoffrules
Dim PlayersPlayingGame
Dim CurrentPlayer
Dim Credits
Dim BonusPoints(4)
Dim BonusHeldPoints(4)
Dim BonusMultiplier(4)
Dim bBonusHeld
Dim BallsRemaining(4)
Dim ExtraBallsAwards(4)
Dim HighScore(4)
Dim HighScoreName(4)
Dim WaffleScore(4)
Dim WaffleScoreName(4)
Dim Jackpot
Dim SuperJackpot
Dim Tilt
Dim TiltSensitivity
Dim Tilted
Dim TotalGamesPlayed
Dim mBalls2Eject
Dim SkillshotValue(4)
Dim bAutoPlunger
Dim bInstantInfo
Dim bromconfig
Dim bAttractMode
Dim LastSwitchHit
Dim BallsOnPlayfield
Dim BallsInHole
Dim bFreePlay
Dim bGameInPlay
Dim bOnTheFirstBall
Dim bBallInPlungerLane
Dim bBallSaverActive
Dim bBallSaverReady
Dim bMultiBallMode
Dim bMusicOn
Dim bSkillshotReady
Dim bExtraBallWonThisBall
Dim bJustStarted
Dim ResetTargetsDelay
Dim NewBallDelay
Dim MatchDelay
Dim BonusCountDelay
Dim Match
Dim Game_Over
Dim Special
Dim Bonus
Dim Ball
'Dim Credits
'Dim Match
'Dim Game_Over
'Dim NewBallDelay
'Dim Special
'Const Special1 = 62000
'Const Special2 = 76000
'Const Special3 = 84000
'Dim Special1Awarded, Special2Awarded, Special3Awarded
'Dim Score, Add10, Add100, Add1000
'Dim HighScore
'Dim Bonus
'Dim BonusMultiplier
'Dim BonusCountDelay
'Dim ResetTargetsDelay
'Dim MatchDelay
'Sub Loadhs
' Dim x
' x = LoadValue(TableName, "HighScore")
' If(x <> "") Then HighScore = CDbl(x) Else HighScore = 10000 End If
'End Sub
'HologramAnim1.enabled = -1
PlaySound "splatter",-1
Sub table1_Init
If UseFlexDMD Then FlexDMD_Init
Set Controller = CreateObject("B2S.Server")
Controller.B2SName = "splatterhouse"
Controller.Run()
If Err Then MsgBox "Can't Load B2S.Server."
Dim ii
Ball = 0:UpdateBallNumber
Credits = 0
Match = 0
StartAttractMode
ScoreReel1.AddValue Score
Timer14.enabled=1
' NewBallDelay = 0
' Special = False
' Special1Awarded = False
' Special1Awarded = False
' Special1Awarded = False
Score = 0
BonusCountDelay = 0
ResetTargetsDelay = 0
MatchDelay = 0
Game_Over = TRUE
Clear_Match
loadhs
CreditReel.Setvalue Credits
ScoreReel1.SetValue Score
'StartShake
GameTimer.Enabled = 1
' reset VP objects
' Setup the lightning according to the nightday slider
If table1.nightday < 50 Then
for each ii in aGiLights: ii.intensity = ii.intensity + (100 - table1.nightday)/10: next
'bumper1light.opacity=bumper1light.opacity + (100 - table1.nightday)^2
'bumper2light.opacity=bumper2light.opacity + (100 - table1.nightday)^2
End If
End Sub
Sub FlexDMD_Init() 'default/startup values
DIm FlexDMDFont
Dim FlexDMDScene
Set FlexDMD = CreateObject("FlexDMD.FlexDMD")
If Not FlexDMD is Nothing Then
FlexDMD.Show = False
FlexDMD.LockRenderThread
'FlexDMD.GameName = cGameName
FlexDMD.RenderMode = 2
FlexDMD.Width = 128
FlexDMD.Height = 32
FlexDMD.Clear = True
FlexDMD.Run = True
Set FlexDMDScene = FlexDMD.NewGroup("Scene")
FlexDMDScene.AddActor FlexDMD.NewImage("Back","FlexDMD.Resources.dmds.black.png")
FlexDMDFont = FlexDMD.NewFont("FlexDMD.Resources.udmd-f12by24.fnt", vbRed, vbGreen, 1)
FlexDMDScene.AddActor(FlexDMD.NewLabel("Score", FlexDMDFont, "0,000,000"))
FlexDMDScene.GetLabel("Score").SetAlignedPosition 4, 1, 0
FlexDMDFont = FlexDMD.NewFont("FlexDMD.Resources.teeny_tiny_pixls-5.fnt", vbGreen, vbBlue, 0)
FlexDMDScene.AddActor(FlexDMD.NewLabel("Ball", FlexDMDFont, "Ball 0"))
FlexDMDScene.GetLabel("Ball").SetAlignedPosition 1, 27, 0
FlexDMDScene.AddActor(FlexDMD.NewLabel("Credit", FlexDMDFont, "Credits 0"))
FlexDMDScene.GetLabel("Credit").SetAlignedPosition 90, 27, 0
FlexDMD.Stage.AddActor FlexDMDScene
FlexDMD.Show = True
FlexDMD.UnlockRenderThread
FlexTimer.Enabled = True
End If
End Sub
Sub FlexTimer_Timer()
FlexDMD.LockRenderThread
With FlexDMD.Stage
.GetLabel("Score").Text = Right(FormatNumber(Score + 10000000, 0, -1, 0, -1),9)
.GetLabel("Ball").Text = "Ball " & CStr(Ball)
.GetLabel("Credit").Text = "Credits " & CStr(Credits)
End With
FlexDMD.UnlockRenderThread
End Sub
Sub Gate2_Timer:Gateheavy.RotX = Gate2.Currentangle:End Sub
Sub GameTimer_Timer
' check the delays
If NewBallDelay > 0 Then
NewBallDelay = NewBallDelay - 1
If NewBallDelay = 0 Then NewBall:End If
End If
If ResetTargetsDelay > 0 Then
ResetTargetsDelay = ResetTargetsDelay - 1
If ResetTargetsDelay = 0 Then ResetDroptargets:End If
End If
If MatchDelay > 0 Then
MatchDelay = MatchDelay - 1
If MatchDelay = 0 Then Verification_Match:End If
End If
If BonusCountDelay > 0 Then
BonusCountDelay = BonusCountDelay - 1
If BonusCountDelay = 0 Then CountBonus:End If
End If
End Sub
Sub Table1_KeyDown(ByVal keycode)
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToEnd
PlaySound "fx_flipperup", 0, .67, -0.05, 0.05
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToEnd
PlaySound "fx_flipperup", 0, .67, 0.05, 0.05
End If
If keycode = PlungerKey Then Plunger.Pullback:PlaySound "fx_Plungerpull"
If keycode = AddCreditKey And Credits < 8 Then
PlaySound "fx_coin"
Addcredits 1
End If
If keycode = AddCreditKey2 And Credits < 8 Then
PlaySound "fx_coin"
AddCredits 2
Savehs
End If
If keycode = StartGameKey And Credits > 0 AND Game_Over = TRUE Then
AddCredits -1
'PlaySound "fx_Startup"
Initialize
Clear_Match
Game_Over = False
NextBall
End If
If keycode = LeftTiltKey Then Nudge 90, 6:PlaySound "fx_nudge"
If keycode = RightTiltKey Then Nudge 270, 6:PlaySound "fx_nudge"
If keycode = CenterTiltKey Then Nudge 0, 7:PlaySound "fx_nudge"
End Sub
Sub Table1_KeyUp(ByVal keycode)
If keycode = PlungerKey Then Plunger.Fire:PlaySound "fx_Plunger"
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToStart
PlaySound "fx_flipperdown", 0, 1, -0.05, 0.05
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToStart
PlaySound "fx_flipperdown", 0, 1, 0.05, 0.05
RotateLaneLightsRight
End If
End Sub
'***************************************
' Ghost flippers
'**************************************
Sub Timer10_Timer
RightFlipperP.Rotz = RightFlipper.CurrentAngle
LeftFlipperP.Rotz = LeftFlipper.CurrentAngle
End Sub
Sub LeftFlipper_Collide(parm)
PlaySound "fx_rubber_flipper", 0, parm / 6, -0.05, 0.05
End Sub
Sub RightFlipper_Collide(parm)
PlaySound "fx_rubber_flipper", 0, parm / 6, 0.05, 0.05
End Sub
'**********************
' Drain and Reset subs
'**********************
' end of ball flow
'1 Drain ball - remove ball
'1 Check Tilt
'2 Count bonus
'3 Check highscore
'4 Next Ball (back to 1 until all balls are played)
'5 Game Over
Sub Drain_Hit()
Drain.DestroyBall
PlaySound "fx_Drain"
CountBonus
End Sub
Sub Initialize 'beginning of a new game
Score = 0
' Special = False
' Special1Awarded = False
' Special1Awarded = False
' Special1Awarded = False
ScoreReel1.ResetToZero
' Bonus = 0
' BonusMultiplier = 0
End Sub
Sub Reset_Table() 'after each new ball
Special = False
'Setup other lights & objects
l16.State = 1 '5 trigger lights
l17.State = 1
ResetTargetsDelay = 10
dtdropped = 0
End Sub
Sub NewBall
PlaySound "fx_ballrel"
BallRelease.CreateBall
BallRelease.Kick 90, 5
StopAttractMode()
End Sub
Sub NextBall()
Ball = Ball + 1
If Ball = Balls then l14.State = 1 'double bonus on the las ball
If Ball > Balls Then 'this is the last ball
GameOver
Else
UpdateBallNumber
Reset_Table
NewBallDelay = 10
End If
End Sub
Sub GameOver
Ball = 0:UpdateBallNumber 'display the game over sign
Game_Over = True
ScoreReel1.ResetToZero
StartAttractMode
End Sub
Sub UpdateBallNumber 'if ball = 0 shows the Game Over
Select Case Ball
Case 0:Ball5.SetValue 0:GameoverR.SetValue 1
Case 1:GameoverR.SetValue 0:Ball1.SetValue 1
Case 2:Ball1.SetValue 0:Ball2.SetValue 1
Case 3:Ball2.SetValue 0:Ball3.SetValue 1
Case 4:Ball3.SetValue 0:Ball4.SetValue 1
Case 5:Ball4.SetValue 0:Ball5.SetValue 1
End Select
End Sub
'*****************
' Tilt
'*****************
Sub IncreaseMatch
Match = (Match + 10) MOD 100
End Sub
Sub Verification_Match()
PlaySound "fx_match"
Display_Match
If(Score MOD 100) = Match Then
ExtraGame
End If
End Sub
Sub AddCredits(value)
Credits = Credits + value
CreditReel.SetValue Credits
End Sub
Sub Clear_Match()
End Sub
Sub Display_Match()
End Sub
Sub ExtraGame()
If Credits < 8 Then
AddCredits 1
End If
PlaySound "fx_knocker"
End Sub
'******************
' GI effects
' independent routine
' it turns on the gi
' when there is a ball
' in play
'******************
'**************
' Score
'**************
Sub AddScore(Points)
Select Case Points
Case 10, 100, 1000
Score = Score + Points
ScoreReel1.AddValue Points
If Points = 100 AND(Score MOD 1000) \ 100 = 0 Then 'New 1000 reel
PlaySound "fx_bell1000"
ElseIf Points = 10 AND(Score MOD 100) \ 10 = 0 Then 'New 100 reel
PlaySound "fx_bell100"
Else
PlaySound "fx_bell" &Points
End If
Case 50
Add10 = Add10 + 5
AddScore10Timer.Enabled = TRUE
Case 500
Add100 = Add100 + 5
AddScore100Timer.Enabled = TRUE
Case 2000, 3000, 4000, 5000
Add1000 = Add1000 + Points \ 1000
AddScore1000Timer.Enabled = TRUE
End Select
' check replays
If Score >= Special1 AND Special1Awarded = False Then
ExtraGame
Special1Awarded = True
End If
If Score >= Special2 AND Special2Awarded = False Then
ExtraGame
Special2Awarded = True
End If
If Score >= Special3 AND Special3Awarded = False Then
ExtraGame
Special3Awarded = True
End If
End Sub
'******************************
'TIMER DE 10, 100 y 1000 PUNTOS
'******************************
Sub AddScore10Timer_Timer()
if Add10 > 0 then
AddScore 10
Add10 = Add10 - 1
Else
Me.Enabled = FALSE
End If
End Sub
Sub AddScore100Timer_Timer()
if Add100 > 0 then
AddScore 100
Add100 = Add100 - 1
Else
Me.Enabled = FALSE
End If
End Sub
Sub AddScore1000Timer_Timer()
if Add1000 > 0 then
AddScore 1000
Add1000 = Add1000 - 1
Else
Me.Enabled = FALSE
End If
End Sub
'***********
' Highscore
'***********
' Load & Save Highscore
Sub Loadhs
Dim x
x = LoadValue(TableName, "HighScore")
If(x <> "") Then HighScore = CDbl(x) Else HighScore = 10000 End If
x = LoadValue(TableName, "Credits")
If(x <> "") then Credits = CInt(x) Else Credits = 0 End If
End Sub
'**************
' Bonus
'**************
Sub AddBonus
If Bonus < 10 Then
Bonus = Bonus + 1
UpdateBonusLights
End If
End Sub
Sub AddBonusMultiplier 'simply turn on the lights
If l14.State = 0 Then
l14.State = 1
ElseIf l15.State = 0 Then
l15.State = 1
End If
End Sub
Sub UpDateBonusLights
Dim ii
ResetBonusLights
If Bonus > 0 Then
For ii = 0 to Bonus-1
' aBonusLights(ii).State = 1
Next
End If
End Sub
Sub CountBonus
If Bonus > 0 Then
Bonus = Bonus -1
AddScore 1000 + 1000 * l14.State + 1000 * l15.State
UpdateBonusLights
BonusCountDelay = 4 + l14.State * 3 + l15.State * 3
Else
BonusCountDelay = 0
ResetBonusLights 'turn off the bonus lights in case of tilt
'reset bonus multiplier lights
l14.State = 0
l15.State = 0
' continue the end of ball procedure
NextBall
End If
End Sub
Sub ResetBonusLights
Dim lamp
For each lamp in aBonusLights
lamp.State = 0
Next
End Sub
'********************
' Diverse Help/Sounds
'********************
Sub aRubbers_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aPostRubbers_Hit(idx):PlaySound "fx_rubber2", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0: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 / 2000)
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 / table1.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
BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
End Function
'*****************************************
' 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) ), 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
'**********************************************************************
' HIT EVENTS: tables switches and events start here
' *********************************************************************
' Table Object Hit Events
'
' Any target hit sub will follow this:
' - play a sound
' - do some physical movement
' - add a score, bonus
' - check some variables/modes this trigger is a member of
' *********************************************************************
'***********
' Bumpers
'***********
Sub Bumper1_Hit
LightEffect 5
If NOT Tilted Then
PlaySoundAt SoundFXDOF("fx_bumper", 107, DOFPulse, DOFContactors), ActiveBall
DOF 110, DOFPulse
DOF 302, DOFPulse 'DOF MX - Bumper 1
AddScore 1000
b1l2.State = 1:b1l1. State = 1
End If
End Sub
Sub Bumper2_Hit
LightEffect 5
If NOT Tilted Then
PlaySoundAt SoundFXDOF("fx_bumper", 109, DOFPulse, DOFContactors), ActiveBall
DOF 111, DOFPulse
DOF 303, DOFPulse 'DOF MX - Bumper 2
AddScore 1000
B2L1.State = 1:b2l2. State = 1
End If
End Sub
Sub Bumper4_Hit
LightEffect 5
If NOT Tilted Then
PlaySoundAt SoundFXDOF("fx_bumper", 108, DOFPulse, DOFContactors), ActiveBall
DOF 112, DOFPulse
DOF 304, DOFPulse 'DOF MX - Bumper 3
AddScore 1000
B4L1.State = 1:B4L2. State = 1
End If
End Sub
Sub Bumper5_Hit
LightEffect 5
If NOT Tilted Then
PlaySoundAt SoundFXDOF("fx_bumper", 108, DOFPulse, DOFContactors), ActiveBall
DOF 112, DOFPulse
DOF 304, DOFPulse 'DOF MX - Bumper 3
AddScore 1000
b5l2.State = 1:b5l1. State = 1
End If
End Sub
Sub Timer6_Timer
B2L1.State = 0:b2l2. State = 0
b1l2.State = 0:b1l1. State = 0
b3l1.State = 0:b3l2. State = 0
B4L1.State = 0:B4L2. State = 0
b5l2.State = 0:b5l1. State = 0
Timer6.Enabled = True
End Sub
Sub Lane1_Hit
PlaySound "sensor"
AddScore 10
End Sub
Sub Lane2_Hit
PlaySound "sensor"
AddScore 10
End Sub
'***************
' Slingshots
'***************
Dim LStep, RStep
Sub LeftSlingShot_Slingshot
PlaySound "fx_slingshot", 0, 1, -0.05, 0.05
'LeftSling1.Visible = 0
LStep = 0
LeftSlingShot.TimerEnabled = 1
' add points
AddScore 10
End Sub
Sub LeftSlingShot_Timer
LeftSlingShot.TimerEnabled = 0
LStep = LStep + 1
End Sub
Sub RightSlingShot_Slingshot
PlaySound "fx_slingshot", 0, 1, 0.05, 0.05
'RightSling1.Visible = 0
RStep = 0
RightSlingShot.TimerEnabled = 1
' add points
AddScore 10
End Sub
Sub RightSlingShot_Timer
RightSlingShot.TimerEnabled = 0
RStep = RStep + 1
End Sub
'*********************
' Targets & switches
'*********************
' Flipper Lanes
Sub sw1_Hit ' left outlane
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
AddBonus
'give extra ball if light is lit
If l12.State = 1 Then
PlaySound "fx_knocker"
Ball = Ball - 1
l1.State = 1
End If
End Sub
Sub sw3_Hit ' right outlane
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
AddBonus
l3.State = 1
'give extra game is light is lit
If l3.State = 1 Then
ExtraGame
End If
End Sub
Sub sw2_Hit ' left inlane
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
l2.State = 1
End Sub
Sub sw4_Hit ' right inlane
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
End Sub
' Top Lanes
Sub sw6_Hit
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
AddBonus
If l27.State = 1 Then
AddBonus
End If
End Sub
Sub sw7_Hit
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
AddBonus
If l26.State = 1 Then
AddBonus
End If
End Sub
Sub sw8_Hit
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
AddBonus
If l25.State = 1 Then
AddBonus
End If
End Sub
Sub sw9_Hit
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
AddBonus
If l24.State = 1 Then
AddBonus
End If
End Sub
Sub sw10_Hit
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
AddBonus
If l23.State = 1 Then
AddBonus
End If
End Sub
' Side Lanes
Sub sw5_Hit
PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0.05
AddScore 500
If l22.State = 1 Then
AddBonusMultiplier
End If
End Sub
Sub sw11_Hit
PlaySound "fx_sensor"
AddScore 500
l11.State = 1
End Sub
Sub sw12_Hit
PlaySound "fx_sensor"
AddScore 500
l12.State = 1
End Sub
Sub sw13_Hit
PlaySound "fx_sensor"
AddScore 500
l13.State = 1
End Sub
' Triggers on top of the red lights
Sub kicker1_hit()
Timer9.enabled = True
end sub
Sub Timer9_timer()
Kicker1.Kick 20,80