-
Notifications
You must be signed in to change notification settings - Fork 37
/
Alive! (Brunswick1978)0.0.3.vbs
1269 lines (1101 loc) · 31.8 KB
/
Alive! (Brunswick1978)0.0.3.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
' -------------------------------------------------
'Aspen Brunswick 1976 Updon719
'Many thanks to Borgdog for the use of his Vulcan table
'as a template and help on a few of the scripting problems
' -------------------------------------------------
'
' 4 Player at 1 Display - Edition by STAT, just a bit changes on the Script
'
' Thalamus 2018-07-18
' Added/Updated "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
' Fix, not using same highscore as Aspen
' Just a few SSF tweaks
Option Explicit
Randomize
Const cGameName = "Aspen"
Dim balls
dim ebcount
Dim replays
Dim hisc
Dim Controller
Dim maxplayers
Dim players
Dim player
Dim credit, dbonus
Dim score(4)
Dim Add50, Add100, Add1000
Dim sreels(4)
Dim Shoot(4), CanPlay(4)
Dim state
Dim tilt
Dim tiltsens
Dim target(9)
Dim Bonus
Dim Bonuslight(19)
Dim ballinplay
Dim ballrenabled
Dim rep
Dim rst
Dim eg
Dim bell
Dim i,j,tnumber, objekt, light, ts
Dim awardcheck
dim rstep, lstep
Dim dw1step, dw2step, dw3step, dw4step, dw5step, dw6step
Dim rw1step, rw2step
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "Can't open controller.vbs"
On Error Goto 0
sub Aspen_init
LoadEM
maxplayers=4
set sreels(1) = ScoreReel1
set sreels(2) = ScoreReel2
set sreels(3) = ScoreReel3
set sreels(4) = ScoreReel4
set Shoot(1)= Shoot1
set Shoot(2)= Shoot2
set Shoot(3)= Shoot3
set Shoot(4)= Shoot4
set CanPlay(1) = CanPlay1
set CanPlay(2) = CanPlay2
set CanPlay(3) = CANPLAY3
set CanPlay(4) = CANPLAY4
player=1
For each light in BonusLights:light.State = 0: Next
For each light in bonusGI:light.State = 0: Next
For each light in bumperlights:light.State = 0: Next
loadhs
if hisc="" then hisc=10000
hstxt.text=hisc
gamov.text="Game Over"
gamov.timerenabled=1
tilttxt.timerenabled=1
if balls="" then balls=5
if balls<>3 and balls<>5 then balls=5
If B2SOn OR Aspen.ShowDT = False Then
setBackglass.enabled=True
For each objekt in Backdropstuff: objekt.visible=false: next
End If
for i = 1 to maxplayers
sreels(i).setvalue(score(i))
next
PlaySound "Tone100"
tilt=false
If Aspen.ShowDT = False then
End If
End sub
sub setBackglass_timer
Controller.B2SSetGameOver 1
Controller.B2SSetScorePlayer 5, hisc
Controller.B2SSetScorePlayer 1, Score(1)
me.enabled=false
end sub
sub gamov_timer
if state=false then
If B2SOn then Controller.B2SSetGameOver 0
gamov.text=""
gtimer.enabled=true
end if
gamov.timerenabled=0
end sub
sub gtimer_timer
if state=false then
gamov.text="Game Over"
If B2SOn then Controller.B2SSetGameOver 1
gamov.timerenabled=1
gamov.timerinterval= (INT (RND*10)+5)*100
end if
me.enabled=0
end sub
sub tilttxt_timer
if state=false then
tilttxt.text=""
If B2SOn then Controller.B2SSetTilt 33,0
ttimer.enabled=true
end if
tilttxt.timerenabled=0
end sub
sub ttimer_timer
if state=false then
tilttxt.text="TILT"
If B2SOn then Controller.B2SSetTilt 33,1
tilttxt.timerenabled=1
tilttxt.timerinterval= (INT (RND*10)+5)*100
end if
me.enabled=0
end sub
Sub NumPlay_Timer
if B2SOn then
if i = 1 and j < 10 then
Controller.B2ssetplayerup 30, players: i = 0
else
Controller.B2ssetplayerup 30, 0: i = 1
end if
j = j + 1:if j = 10 then Controller.B2ssetplayerup 30, player:NumPlay.enabled=false
end if
End Sub
Sub Aspen_KeyDown(ByVal keycode)
if keycode=StartGameKey then
TurnScores.enabled=false
if state=false then
coindelay.enabled=true
playsound "startup"
ballinplay=1
player=1
If b2son Then
Controller.B2ssetballinplay 32, Ballinplay
Controller.B2ssetplayerup 30, 1
Controller.B2SSetGameOver 0
End If
shoot(player).state=1
tilt=false
state=true
CanPlay(player).state=1
players=1
rst=0
resettimer.enabled=true
else if state=true and players < maxplayers and Ballinplay=1 then
credit=credit+1
players=players+1
i=1:j=0:NumPlay.enabled=true
CanPlay(players).state=1
playsound "tone500"
end if
end if
end if
If keycode = PlungerKey Then
Plunger.PullBack
PlaySound "fx_plungerpull",0,1,0.25,0.25
End If
if tilt=false and state=true then
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToEnd
PlaySound SoundFXDOF("flipperup",101,DOFOn,DOFContactors), 0, .67, -0.05, 0.05
PlaySoundAt "Buzz", LeftFlipper
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToEnd
PlaySound SoundFXDOF("flipperup",102,DOFOn,DOFContactors), 0, .67, 0.05, 0.05
PlaySoundAt "Buzz1", RightFlipper
End If
If keycode = LeftTiltKey Then
Nudge 90, 2
checktilt
End If
If keycode = RightTiltKey Then
Nudge 270, 2
checktilt
End If
If keycode = CenterTiltKey Then
Nudge 0, 2
checktilt
End If
If keycode = MechanicalTilt Then
' Nudge 0, 2
checktilt
End If
end IF
end sub
Sub Aspen_KeyUp(ByVal keycode)
If keycode = PlungerKey Then
Plunger.Fire
PlaySound "plunger",0,1,0.25,0.25
End If
if keycode = LeftFlipperKey then
OperatorMenuTimer.Enabled = false
end if
If tilt=false and state=true then
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToStart
PlaySound SoundFXDOF("flipperdown",101,DOFOff,DOFContactors), 0, 1, -0.05, 0.05
StopSound "Buzz"
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToStart
PlaySound SoundFXDOF("flipperdown",102,DOFOff,DOFContactors), 0, 1, 0.05, 0.05
StopSound "Buzz1"
End If
End if
End Sub
sub flippertimer_timer()
LFlip.RotY = LeftFlipper.CurrentAngle
RFlip.RotY = RightFlipper.CurrentAngle
end sub
sub coindelay_timer
coindelay.enabled=false
end sub
sub resettimer_timer
rst=rst+1
for i = 1 to maxplayers
sreels(i).resettozero
next
If b2son then
for i = 1 to maxplayers
Controller.B2SSetScorePlayer 1, 0
Controller.B2SSetScoreRollover 24 + i, 0
next
End If
if rst=18 then
playsound "flipperup"
end if
if rst=22 then
newgame
resettimer.enabled=false
end if
end sub
Sub addcredit
credit=credit+1
DOF 133, DOFOn
End sub
Sub Drain_Hit()
DOF 129, DOFPulse
If LTxBall.state = 1 Then Playsound "shootagain"
PlaySoundAt "drain", Drain
Drain.DestroyBall
me.timerenabled=1
If DBlight.state=1 or TRlight.state=1 Then
DBlight.state=0
TRlight.state=0
'LightA.state=1
'LightB.state=1
'LightC.state=1
end if
for each light in targetlights:light.state=1:Next
for each light in bonusGI:light.state=0:Next
for each light in BonusLights:light.state=0:next
LTxball.state=0
End Sub
Sub Drain_timer
if trlight.state=1 then
bonus=bonus*3
else
if dblight.state=1 then bonus=bonus*2
end if
dbonus=1
scorebonus.enabled=true
me.timerenabled=0
End Sub
sub ballhome_hit
ballrenabled=1
end sub
sub ballhome_unhit
DOF 134, DOFPulse
end sub
sub ballrel_hit
if ballrenabled=1 then
shootagain.state=lightstateoff
ballrenabled=0
end if
end sub
sub ScoreBonus_timer
if tilt=false and bonus>0 then
score(player)=score(player)+(1000*dbonus)
sreels(player).addvalue(1000*dbonus)
If B2SOn Then Controller.B2SSetScorePlayer 1, score(player) 'MOD 100000
If dbonus=2 Then
PlaySound SoundFXDOF("tone1000",143,DOFPulse,DOFChimes)
Elseif dbonus=3 then
PlaySound SoundFXDOF("tone1000",143,DOFPulse,DOFChimes)
Else
PlaySound SoundFXDOF("tone1000",143,DOFPulse,DOFChimes)
End If
bonus=bonus-1
else
bonus=0
for each light in bonuslights: light.state=0: next
end if
if bonus=0 then
if shootagain.state=lightstateon then
newball
ballreltimer.enabled=true
else
if players=1 or player=players then
player=1
Else
player=player+1
end if
If B2SOn Then Controller.B2SSetScorePlayer 1, score(player):Controller.B2ssetplayerup 30, player
for i = 1 to 4: Shoot(i).state=0: Next
shoot(player).state=1
nextball
end if
scorebonus.enabled=false
end if
End sub
sub newgame
player=1
shoot(player).state=1
ebcount=0
for i = 1 to 4:
score(i)=0
next
If b2son then
Controller.B2SSetScorePlayer 1, 0
End If
eg=0
rep=0
shootagain.state=lightstateoff
for each light in bonusGI:light.state=0:next
for each light in bumperlights:light.state=1:next
for each light in BonusLights:light.state=0:next
for each light in targetlights:light.state=1:next
gamov.text=" "
tilttxt.text=" "
If b2son then
Controller.B2SSetGameOver 0
Controller.B2SSetTilt 33,0
End If
biptext.text="1"
BallRelease.CreateBall
BallRelease.kick 60,35,0
playsound SoundFXDOF("newball",128,DOFPulse,DOFContactors)
end sub
sub newball
ShootAgain.state=0
End Sub
sub nextball
if tilt=true then
bumper1.force=12
tilt=false
tilttxt.text=" "
If b2son then
Controller.B2SSetTilt 33,0
Controller.B2ssetdata 1, 1
End If
end if
ebcount=0
if player=1 then ballinplay=ballinplay+1
if ballinplay>balls then
playsound "game end"
eg=1
ballreltimer.enabled=true
else
if state=true and tilt=false then
newball
ballreltimer.enabled=true
end if
biptext.text=ballinplay
If b2son then Controller.B2ssetballinplay 32, Ballinplay
end if
End Sub
sub ballreltimer_timer
if eg=1 then
turnoff
biptext.text=" "
state=false
gamov.text="GAME OVER"
for i=1 to maxplayers
CanPlay(i).state=0
Shoot(i).state=0
if score(i)>hisc then hisc=score(i)
next
hstxt.text=hisc
savehs
If b2son then
Controller.B2SSetGameOver 1
Controller.B2ssetballinplay 32, 0
Controller.B2SSetScorePlayer 5, hisc
Controller.B2ssetPlayerUp 30, 0
End If
ballreltimer.enabled=false
ts = 1:TurnScores.enabled=true
else
BallRelease.CreateBall
BallRelease.kick 60,45,0
playsound SoundFXDOF("newball",128,DOFPulse,DOFContactors)
ballreltimer.enabled=false
end if
end sub
Sub TurnScores_Timer
If B2SOn Then
Controller.B2SSetScorePlayer 1, score(ts)
Controller.B2ssetPlayerUp 30, ts
ts = ts + 1
if ts > players then ts = 1
End If
End Sub
'********** Bumpers
Sub Bumper1_Hit
if tilt=false then
LightBumper1.state=1
playsound SoundFXDOF("fx_bumper4",107,DOFPulse,DOFContactors)
DOF 108,DOFPulse
addscore 1000
me.timerenabled=1
end if
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
end if
End Sub
Sub Bumper1_timer
Bumper1Ring.Enabled=0
BumperRing1.transz=BumperRing1.transz-4
if BumperRing1.transz=-36 then
Bumper1Ring.enabled=1
me.timerenabled=0
end if
End Sub
Sub Bumper1Ring_timer
BumperRing1.transz=BumperRing1.transz+4
If BumperRing1.transz=0 then Bumper1Ring.enabled=0
End sub
'************Spinners
Sub Spinner1_Spin
if tilt=false then
LightSpinner1.state=1
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
PlaySoundAt "fx_spinner", Spinner1
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
end if
end If
end if
End Sub
Sub Spinner2_Spin
if tilt=false then
LightSpinner2.state=1
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
PlaySoundAt "fx_spinner", Spinner2
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
end if
end If
end if
End Sub
Sub Spinner3_Spin
if tilt=false then
LightSpinner3.state=1
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
PlaySoundAt "fx_spinner", Spinner3
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
end if
end if
end if
End Sub
'************** Slings
Sub RightSlingShot_Slingshot
playsound SoundFXDOF("right_slingshot",105,DOFPulse,DOFContactors), 0, 1, 0.05, 0.05
DOF 106,DOFPulse
LightRightSlingShot.State=1
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
addbonus
LightRightSlingShot.state=1
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
RSling.Visible = 0
RSling1.Visible = 1
slingR.objroty = -15
RStep = 1
RightSlingShot.TimerEnabled = 1
end if
end if
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:slingR.objroty = -7
Case 4: slingR.objroty = 0:RSLing2.Visible = 0:RSLing.Visible = 1:RightSlingShot.TimerEnabled = 0
End Select
RStep = RStep + 1
End Sub
Sub LeftSlingShot_Slingshot
playsound SoundFXDOF("left_slingshot",103,DOFPulse,DOFContactors), 0, 1, -0.05, 0.05
DOF 104,DOFPulse
LightLeftSlingShot.state=1
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
addbonus
LightLeftSlingShot.state=1
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
LSling.Visible = 0
LSling1.Visible = 1
slingL.objroty = 15
LStep = 1
LeftSlingShot.TimerEnabled = 1
end if
end if
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:slingL.objroty = 7
Case 4:slingL.objroty = 0:LSLing2.Visible = 0:LSLing.Visible = 1:LeftSlingShot.TimerEnabled = 0
End Select
LStep = LStep + 1
End Sub
'************** Dingwalls
sub dingwall1_hit
if tilt=false then
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
end if
rdw1.visible=0
RDW1a.visible=1
dw1step=1
Me.timerenabled=1
end if
end sub
sub dingwall1_timer
select case dw1step
Case 1: RDW1a.visible=0: rdw1.visible=1
case 2: rdw1.visible=0: rdw1b.visible=1
Case 3: rdw1b.visible=0: rdw1.visible=1: Me.timerenabled=0
end Select
dw1step=dw1step+1
end sub
sub dingwall2_hit
if tilt=false then
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
end if
rdw2.visible=0
RDW2a.visible=1
dw2step=1
Me.timerenabled=1
end if
end sub
sub dingwall2_timer
select case dw2step
Case 1: RDW2a.visible=0: rdw2.visible=1
case 2: rdw2.visible=0: rdw2b.visible=1
Case 3: rdw2b.visible=0: rdw2.visible=1: me.timerenabled=0
end Select
dw2step=dw2step+1
end sub
sub dingwall3_hit
if tilt=false then
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
Rdw3.visible=0
RDW3a.visible=1
dw3step=1
Me.timerenabled=1
end if
end if
end sub
sub dingwall3_timer
select case dw3step
Case 1: RDW3a.visible=0: Rdw3.visible=1
case 2: Rdw3.visible=0: rdw3b.visible=1
Case 3: rdw3b.visible=0: Rdw3.visible=1: me.timerenabled=0
end Select
dw3step=dw3step+1
end sub
sub dingwall4_hit
if tilt=false then
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
Rdw4.visible=0
RDW4a.visible=1
dw4step=1
Me.timerenabled=1
end if
end if
end sub
sub dingwall4_timer
select case dw4step
Case 1: RDW4a.visible=0: Rdw4.visible=1
case 2: Rdw4.visible=0: rdw4b.visible=1
Case 3: rdw4b.visible=0: Rdw4.visible=1: me.timerenabled=0
end Select
dw4step=dw4step+1
end sub
sub dingwall5_hit
if tilt=false then
Lightdingwall5.state=1
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
addbonus
end if
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
end if
Rdw5.visible=0
RDW5a.visible=1
dw5step=1
Me.timerenabled=1
end if
end sub
sub dingwall5_timer
select case dw5step
Case 1: RDW5a.visible=0: Rdw5.visible=1
case 2: Rdw5.visible=0: rdw5b.visible=1
Case 3: rdw5b.visible=0: Rdw5.visible=1: me.timerenabled=0
end Select
dw5step=dw5step+1
end sub
sub dingwall6_hit
If tilt=false then
Lightdingwall6.state=1
if Lbulb7.state=1 Then
addscore 500
Else
addscore 50
addbonus
end if
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
end if
Rdw6.visible=0
RDW6a.visible=1
dw6step=1
Me.timerenabled=1
end if
end sub
sub dingwall6_timer
select case dw6step
Case 1: RDW6a.visible=0: Rdw6.visible=1
case 2: Rdw6.visible=0: rdw6b.visible=1
Case 3: rdw6b.visible=0: Rdw6.visible=1: me.timerenabled=0
end Select
dw6step=dw6step+1
end sub
'********** Triggers
sub TGtop_hit
DOF 115, DOFPulse
if tilt=false then
addscore 1000
for each light in bonusGI:light.state=1:Next
playsound "bonus"
LightTGtop.state=1
if Lightdingwall5.state=1 and LightTGtop.state=1 and LightBumper1.state=1 and Lightdingwall6.state=1 and LightSpinner2.state=1 and LightSpinner3.state=1 and LightSpinner1.state=1 and LightLeftSlingShot.state=1 and LightRightSlingShot.state=1 Then
LTxball.state=1
end if
end if
end sub
sub outL_hit
DOF 120, DOFPulse
if tilt=False then
addbonus
if Lbulb7.state=1 Then
addscore 1000
Else
addscore 100
end if
if LTxball.state=1 then Shootagain.state=1
end if
end Sub
sub outR_hit
DOF 121, DOFPulse
if tilt=False then
addbonus
if Lbulb7.state=1 Then
addscore 1000
Else
addscore 100
end if
if LTxball.state=1 then Shootagain.state=1
end if
end Sub
'******Targets
Sub TargetA_hit
DOF 126, DOFPulse
LightA.state=0
addbonus
addbonus
if Lbulb7.state=1 Then
addscore 1000
Else
addscore 100
end if
if LightA.state=0 and LightC.state=0 then DBlight.state=1
if LightA.state=0 and LightB.state=0 and LightC.state=0 Then
TRlight.state=1
DBlight.state=1
PlaysoundAt "lower bonus", TargetA
End If
end Sub
Sub TargetB_hit
DOF 127, DOFPulse
LightB.state=0
addbonus
addbonus
if Lbulb7.state=1 Then
addscore 1000
Else
addscore 100
end if
if LightA.state=0 and LightC.state=0 then DBlight.state=1
if LightA.state=0 and LightB.state=0 and LightC.state=0 Then
TRlight.state=1
DBlight.state=1
PlaysoundAt "lower bonus", TargetB
End If
end sub
Sub TargetC_hit
DOF 127, DOFPulse
LightC.state=0
addbonus
addbonus
if Lbulb7.state=1 Then
addscore 1000
Else
addscore 100
end if
if LightA.state=0 and LightC.state=0 then DBlight.state=1
if LightA.state=0 and LightB.state=0 and LightC.state=0 Then
TRlight.state=1
DBlight.state=1
PlaysoundAt "lower bonus", TargetC
End If
end Sub
sub addscore(points)
if tilt=false then
If Points < 100 and AddScore50Timer.enabled = false Then
Add50 = Points \ 50
AddScore50Timer.Enabled = TRUE
ElseIf Points < 1000 and AddScore100Timer.enabled = false Then
Add100 = Points \ 100
AddScore100Timer.Enabled = TRUE
ElseIf AddScore1000Timer.enabled = false Then
Add1000 = Points \ 1000
AddScore1000Timer.Enabled = TRUE
End If
end if
End Sub
Sub AddScore50Timer_Timer()
if Add50 > 0 then
AddPoints 50
Add50 = Add50 - 1
Else
Me.Enabled = FALSE
End If
End Sub
Sub AddScore100Timer_Timer()
if Add100 > 0 then
AddPoints 100
Add100 = Add100 - 1
Else
Me.Enabled = FALSE
End If
End Sub
Sub AddScore1000Timer_Timer()
if Add1000 > 0 then
AddPoints 1000
Add1000 = Add1000 - 1
Else
Me.Enabled = FALSE
End If
End Sub
Sub AddPoints(Points)
score(player)=score(player)+points
sreels(player).addvalue(points)
If B2SOn Then Controller.B2SSetScorePlayer 1, score(player) 'MOD 100000
'Sounds: there are 3 sounds: tens, hundreds and thousands
If Points = 100 AND(Score(player) MOD 1000) \ 100 = 0 Then
PlaySound SoundFXDOF("tone50",143,DOFPulse,DOFChimes)
ElseIf Points = 50 AND(Score(player) MOD 100) \ 50 = 0 Then
PlaySound SoundFXDOF("tone50",142,DOFPulse,DOFChimes)
ElseIf points = 1000 Then
PlaySound SoundFXDOF("tone1000",143,DOFPulse,DOFChimes)
elseif Points = 100 Then
PlaySound SoundFXDOF("tone100",142,DOFPulse,DOFChimes)
Else
PlaySound SoundFXDOF("tone50",141,DOFPulse,DOFChimes)
End If
end sub
Sub CheckTilt
If Tilttimer.Enabled = True Then
TiltSens = TiltSens + 1
if TiltSens = 3 Then
Tilt = True
tilttxt.text="TILT"
If b2son Then Controller.B2SSetTilt 33,1
If b2son Then Controller.B2ssetdata 1, 0
playsound "tilt"
turnoff
End If
Else
TiltSens = 0
Tilttimer.Enabled = True
End If
End Sub
Sub Tilttimer_Timer()
Tilttimer.Enabled = False
End Sub
sub turnoff
LeftFlipper.RotateToStart
DOF 101, DOFOff
StopSound "Buzz"
RightFlipper.RotateToStart
DOF 102, DOFOff
StopSound "Buzz1"
end sub
Sub addbonus
bonus=bonus+1
if bonus > 19 then bonus = 19
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, PAN and PITCH functions, so the volume and pitch of the sound
' will change according to the ball speed, and the PAN function 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.