-
Notifications
You must be signed in to change notification settings - Fork 37
/
4 Queens (Bally 1970) VP10.vbs
1363 lines (1174 loc) · 32.1 KB
/
4 Queens (Bally 1970) VP10.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
'Option Explicit
'Randomize
' Thalamus 2020 July : Improved directional sounds
' !! NOTE : Table not verified yet !!
' Options
' Volume devided by - lower gets higher sound
Const VolDiv = 2000 ' Lower number, louder ballrolling/collition sound
Const VolCol = 10 ' Ball collition divider ( voldiv/volcol )
dim ballinplay
dim ballrelenabled
dim rst
dim eg
dim credit
dim score
dim truesc
dim match(9)
dim rep
dim tilt
dim tiltsens
dim state
dim cred
dim plm
dim update
dim digit
dim tempscore
dim scn
dim scn1
dim bell
dim points
dim matchnumb
dim replay1
dim replay2
dim replay3
dim replay4
dim hisc
dim rs(3)
dim rv(3)
dim sv
dim sv1
dim i
dim TextStr
dim reel(2)
dim hv
dim wv
dim qs
Dim B2SOn
Dim controller
ExecuteGlobal GetTextFile("core.vbs")
sub Table1_init
If ShowDT=false Then
for each obj in DTItems
obj.visible=False
Next
end If
set match(0)=m0
set match(1)=m1
set match(2)=m2
set match(3)=m3
set match(4)=m4
set match(5)=m5
set match(6)=m6
set match(7)=m7
set match(8)=m8
set match(9)=m9
set reel(1)=reel1
replay1=43000
replay2=54000
replay3=65000
replay4=76000
loadhs
if hisc="" then hisc=10000
reel1.setvalue(score)
reel2.setvalue(hisc)
if credit="" then credit=0
credittxt.text=credit
select case(matchnumb)
case 0:
m0.text="00"
case 1:
m1.text="10"
case 2:
m2.text="20"
case 3:
m3.text="30"
case 4:
m4.text="40"
case 5:
m5.text="50"
case 6:
m6.text="60"
case 7:
m7.text="70"
case 8:
m8.text="80"
case 9:
m9.text="90"
end select
B2SOn=True
if B2SOn then
Set Controller = CreateObject("B2S.Server")
Controller.B2SName = "Bally4Queens_1970"
Controller.Run()
If Err Then MsgBox "Can't Load B2S.Server."
end if
If B2SOn Then
if matchnumb=0 then
Controller.B2SSetMatch 10
else
Controller.B2SSetMatch matchnumb
end if
Controller.B2SSetScoreRolloverPlayer1 0
Controller.B2SSetTilt 1
Controller.B2SSetCredits Credit
Controller.B2SSetGameOver 1
Controller.B2SSetData 81,0
Controller.B2SSetData 82,0
Controller.B2SSetData 83,0
Controller.B2SSetData 84,0
End If
for i=1 to 4
If B2SOn Then
Controller.B2SSetScorePlayer i, 0
End If
next
End Sub
Sub Table1_KeyDown(ByVal keycode)
if keycode=6 then
playsoundAtVol "coin3", Drain, 1
coindelay.enabled=true
end if
if keycode=2 and credit>0 and state=false then
credit=credit-1
If B2SOn Then
Controller.B2SSetCredits Credit
end if
qs=qs-1
if qs<0 then qs=0
playsound "click"
credittxt.text=credit
tilt=false
state=true
rst=0
ballinplay=1
playsound "initialize"
resettimer.enabled=true
If B2SOn Then
Controller.B2SSetTilt 0
Controller.B2SSetGameOver 0
Controller.B2SSetMatch 0
Controller.B2SSetCredits Credit
Controller.B2SSetCanPlay 1
Controller.B2SSetPlayerUp 1
Controller.B2SSetData 81,0
Controller.B2SSetData 82,0
Controller.B2SSetData 83,0
Controller.B2SSetData 84,0
Controller.B2SSetBallInPlay BallInPlay
Controller.B2SSetScoreRolloverPlayer1 0
End If
end if
If keycode = PlungerKey Then
Plunger.PullBack
End If
if tilt=false and state=true then
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToEnd
LeftFlipper1.RotateToEnd
playsoundAtVol "buzz", LeftFlipper, 1
PlaySoundAtVol "FlipperUp", LeftFlipper, 1
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToEnd
RightFlipper1.RotateToEnd
playsoundAtVol "buzz", RightFlipper, 1
PlaySoundAtVol "FlipperUp", RightFlipper, 1
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
mechchecktilt
End If
end if
End Sub
Sub Table1_KeyUp(ByVal keycode)
If keycode = PlungerKey Then
playsoundAtVol "plunger", Plunger, 1
Plunger.Fire
End If
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToStart
LeftFlipper1.RotateToStart
stopsound "buzz"
if tilt=false and state=true then
PlaySoundAtVol "FlipperDown", RightFlipper, 1
PlaySoundAtVol "FlipperDown", LeftFlipper, 1
End If
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToStart
RightFlipper1.RotateToStart
stopsound "buzz"
if tilt=false and state=true then
PlaySoundAtVol "FlipperDown", LeftFlipper, 1
PlaySoundAtVol "FlipperDown", RigthFlipper, 1
End If
End If
End Sub
Sub FlipperTimer_timer()
LFlip.Rotz = LeftFlipper.CurrentAngle
LFlip1.Rotz = LeftFlipper1.CurrentAngle
RFlip.Rotz = RightFlipper.CurrentAngle
RFlip1.Rotz = RightFlipper1.CurrentAngle
End Sub
sub coindelay_timer
playsound "click"
credit=credit+5
if credit>25 then credit=25
credittxt.text=credit
coindelay.enabled=false
If B2SOn Then
Controller.B2SSetCredits Credit
end if
End Sub
sub resettimer_timer
rst=rst+1
reel1.resettozero
If B2SOn Then
Controller.B2SSetScorePlayer1 0
end if
if rst=14 then
playsound "kickerkick"
end if
if rst=18 then
newgame
resettimer.enabled=false
end if
End Sub
sub newgame
bumper1.force=12
bumper2.force=12
bumper3.force=12
score=0
truesc=0
eg=0
rep=0
sv=0
bumperlight1.state=lightstateoff
bumperlight2.state=0
bumperlight3.state=0
Light7.State=0
Light8.State=0
Light9.State=0
Light10.State=0
Light11.State=0
LightA.State=2
LightB.State=0
LightC.State=0
LightD.State=0
gamov.text=" "
tilttxt.text=" "
bip5.text=" "
bip1.text="1"
for i=0 to 9
match(i).text=" "
next
resettimer.enabled=Trus
nb.CreateBall
nb.kick 135,6
If B2SOn then Controller.B2SSetBallInPlay 1
End Sub
sub newball
bumperlight1.state=0
bumperlight2.state=0
bumperlight3.state=0
End Sub
Sub Drain_Hit()
PlaySoundAt "drainshorter", Drain
Drain.DestroyBall
flipopen
nextball
End Sub
sub nextball
if tilt=true then
bumper1.force=12
bumper2.force=12
bumper3.force=12
tilt=false
If B2SOn Then Controller.B2SSetTilt 0
tilttxt.text=" "
end if
LightA.State=2
LightB.State=0
LightC.State=0
LightD.State=0
hv=0
Light1.State=0
Light2.State=0
Light3.State=0
Light4.State=0
Light5.State=0
ballinplay=ballinplay+1
if ballinplay>5 then
playsound "motorleer"
If B2SOn then Controller.B2SSetBallInPlay 0
eg=1
ballreltimer.enabled=true
else
if state=true and tilt=false then
newball
playsound "kickerkick"
ballreltimer.enabled=true
end if
If B2SOn then Controller.B2SSetBallInPlay ballinplay
select case (ballinplay)
case 1:
bip1.text="1"
case 2:
bip1.text=" "
bip2.text="2"
case 3:
bip2.text=" "
bip3.text="3"
case 4:
bip3.text=" "
bip4.text="4"
case 5:
bip4.text=" "
bip5.text="5"
end select
end if
End Sub
sub ballreltimer_timer
if eg=1 then
matchnum
bip5.text=" "
state=false
gamov.text="GAME OVER"
If B2SOn Then
Controller.B2SSetGameOver 1
end if
if truesc>hisc then hisc=truesc
reel2.setvalue(hisc)
savehs
ballreltimer.enabled=false
else
nb.CreateBall
nb.kick 90,4
ballreltimer.enabled=false
end if
End Sub
sub matchnum
select case(matchnumb)
case 0:
m0.text="00"
case 1:
m1.text="10"
case 2:
m2.text="20"
case 3:
m3.text="30"
case 4:
m4.text="40"
case 5:
m5.text="50"
case 6:
m6.text="60"
case 7:
m7.text="70"
case 8:
m8.text="80"
case 9:
m9.text="90"
end select
If B2SOn Then
if matchnumb=0 then
Controller.B2SSetMatch 100
else
Controller.B2SSetMatch (matchnumb*10)
end if
end if
if (matchnumb*10)=(score mod 100) then
credit=credit+1
qs=qs+2
playsound "knocke"
if credit>25 then credit=25
If B2SOn Then
Controller.B2SSetCredits Credit
end if
credittxt.text=credit
playsound "click"
end if
End Sub
sub addscore(points)
if tilt=false then
bell=0
scn=0
if points = 10 or points = 100 or points=1000 then scn=1
if points = 5000 then
reel(1).addvalue(5000)
bell=1
scn=5
end if
if points = 4000 then
reel(1).addvalue(4000)
bell=1
scn=4
end if
if points = 3000 then
reel(1).addvalue(3000)
bell=1
scn=3
end if
if points = 2000 then
reel(1).addvalue(2000)
bell=1
scn=2
end if
if points = 1000 then
reel(1).addvalue(1000)
bell=1
end if
if points = 500 then
reel(1).addvalue(500)
bell=2
scn=5
end if
if points = 300 then
reel(1).addvalue(300)
bell=2
scn=3
end if
if points = 100 then
reel(1).addvalue(100)
bell=2
end if
if points = 10 then
reel(1).addvalue(10)
bell=3
end if
scn1=0
scntimer.enabled=true
score=score+points
truesc=truesc+points
If B2SOn Then
Controller.B2SSetScore 1,score
end if
if score=>100000 then
score=score-100000
rep=0
end if
if score=>replay1 and rep=0 then
credit=credit+1
qs=qs+2
playsound "knocke"
if credit>25 then credit=25
credittxt.text=credit
If B2SOn Then
Controller.B2SSetCredits Credit
end if
rep=1
playsound "click"
end if
if score=>replay2 and rep=1 then
credit=credit+1
qs=qs+2
playsound "knocke"
if credit>25 then credit=25
credittxt.text=credit
If B2SOn Then
Controller.B2SSetCredits Credit
end if
rep=2
playsound "click"
end if
if score=>replay3 and rep=2 then
credit=credit+1
qs=qs+2
playsound "knocke"
if credit>25 then credit=25
credittxt.text=credit
If B2SOn Then
Controller.B2SSetCredits Credit
end if
rep=3
playsound "click"
end if
if score=>replay4 and rep=3 then
credit=credit+1
qs=qs+2
playsound "knocke"
if credit>25 then credit=25
credittxt.text=credit
If B2SOn Then
Controller.B2SSetCredits Credit
end if
rep=4
playsound "click"
end if
end if
End Sub
sub wheelcheck
If wv=>10 then wv=0
If wv=0 or wv=1 then
LightT1.state=1
LightT2.state=0
Light6.state=0
quickstep
End If
If wv=2 or wv=3 then
LightT1.state=1
LightT2.state=1
Light6.state=0
quickstep
End If
If wv=4 or wv=5 then
LightT1.state=1
LightT2.state=1
Light6.state=1
quickstep
End If
If wv=6 or wv=7 then
LightT1.state=0
LightT2.state=1
Light6.state=1
quickstep
End If
If wv=8 or wv=9 then
LightT1.state=0
LightT2.state=0
Light6.state=1
quickstep
End If
End Sub
Sub quickstep
If wv=1 and qs>=8 then
LightT1.state=0
LightT2.state=0
Light6.state=0
End If
If wv=3 and qs>=12 then
LightT1.state=0
LightT2.state=0
Light6.state=0
End If
If (wv=4 or wv=5) and qs>=16 then
LightT1.state=0
LightT2.state=0
Light6.state=0
End If
If wv=7 and qs>=20 then
LightT1.state=0
LightT2.state=0
Light6.state=0
End If
If wv=9 and qs>=24 then
LightT1.state=0
LightT2.state=0
Light6.state=0
End If
If qs>32 then qs=32
End Sub
sub scntimer_timer
scn1=scn1 + 1
matchnumb=matchnumb+1
if matchnumb=10 then matchnumb=0
if bell=3 then playsound "bell10",0, 0.30, 0, 0
if bell=2 then playsound "bell100",0, 0.30, 0, 0
if bell=1 then playsound "bell1000",0, 0.45, 0, 0
if scn1=scn then
wv=wv+1
wheelcheck
if wv=>10 then wv=0
scntimer.enabled=false
end if
End Sub
Sub CheckTilt
If Tilttimer.Enabled = True Then
TiltSens = TiltSens + 1
if TiltSens = 2 Then
Tilt = True
tilttxt.text="TILT"
If B2SOn Then Controller.B2SSetTilt 1
playsound "tilt"
if truesc>hisc then hisc=truesc
reel2.setvalue(hisc)
savehs
turnoff
End If
Else
TiltSens = 0
Tilttimer.Enabled = True
End If
End Sub
Sub Tilttimer_Timer()
Tilttimer.Enabled = False
End Sub
sub turnoff
bumper1.force=0
bumper2.force=0
bumper3.force=0
End Sub
sub bumper1_hit
if tilt=false then PlaySoundAt "jet2", bumper1
if (bumperlight1.state)=1 then
addscore 100
else
addscore 10
end if
End Sub
sub bumper2_hit
if tilt=false then PlaySoundAt "jet2", bumper2
if (bumperlight2.state)=1 then
addscore 100
else
addscore 10
end if
End Sub
sub bumper3_hit
if tilt=false then PlaySoundAt "jet2", bumper3
if (bumperlight3.state)=1 then
addscore 100
else
addscore 10
end if
End Sub
Sub BumperA_Hit()
Addscore 1000
PlaysoundAt "gigibump3loud", BumperA
If LightA.State=2 then LightCheck
End Sub
Sub BumperB_Hit()
Addscore 1000
PlaysoundAt "gigibump3loud", BumperB
If LightB.State=2 then LightCheck
End Sub
Sub BumperC_Hit()
Addscore 1000
PlaysoundAt "gigibump3loud", BumperC
If LightC.State=2 then LightCheck
End Sub
Sub BumperD_Hit()
Addscore 1000
PlaysoundAt "gigibump3loud", BumperD
If LightD.State=2 then LightCheck
End Sub
Sub Kicker1_Hit()
If Light6.State=1 then LightCheck
If Light6.State=1 then Addscore 3000 Else Addscore 300
PlaySoundAt "kickerkick", Kicker1
KickTimer.enabled=True
End Sub
Sub Kicker2_Hit()
If hv=0 then Addscore 500
if tilt=false then
hv=hv+1
If hv>=6 and (Light5.State=1 or Light5.State=2) then Addscore 5000: Light5.State=1
If hv=5 then Light5.State=2: Addscore 4000: Light4.State=1
If hv=4 then Light4.State=2: Addscore 3000: Light3.State=1
If hv=3 then Light3.State=2: Addscore 2000: Light2.State=1
If hv=2 then Light2.State=2: Addscore 1000: Light1.State=1
If hv=1 then Light1.State=2
If hv>6 then hv=0
If hv=0 then Light1.State=0: Light2.State=0: Light3.State=0: Light4.State=0: Light5.State=0
End If
flipclose
PlaySoundAt "kickerkick", Kicker2
KickTimer.enabled=True
End Sub
sub kicktimer_timer
Kicker1.kick (int(rnd(1)*10)+230),12
Kicker2.kick (int(rnd(1)*10)+163),12
kicktimer.enabled=false
End Sub
Sub Trigger1_Hit()
Addscore 10
End Sub
Sub Trigger2_Hit()
Addscore 10
End Sub
Sub Trigger3_Hit()
Addscore 100
BumperLight1.State=1
BumperLight3.State=1
End Sub
Sub Trigger4_Hit()
Addscore 1000
If Light7.State=1 then
credit= credit+1
If B2SOn Then
Controller.B2SSetCredits Credit
end if
qs=qs+2
Playsound "Knocke"
Light7.State=0
End If
End Sub
Sub Trigger5_Hit()
Addscore 100
BumperLight2.State=1
End Sub
Sub Trigger6_Hit()
Addscore 1000
End Sub
Sub Trigger7_Hit()
Addscore 1000
End Sub
Sub Target1_Hit()
If LightT1.State=1 then LightCheck
If LightT1.State=1 then Addscore 1000: Playsound "Bell1000" Else Addscore 100: playsound "Bally100"
End Sub
Sub Target2_Hit()
If LightT2.State=1 then LightCheck
If LightT2.State=1 then Addscore 1000: Playsound "Bell1000" Else Addscore 100: playsound "Bally100"
End Sub
Sub LightCheck
If LightD.State=2 then LightD.State=1
If LightC.State=2 and LightD.State=0 then LightC.State=1: LightD.State=2
If LightB.State=2 and LightC.State=0 then LightB.State=1: LightC.State=2
If LightA.State=2 and LightB.State=0 then LightA.State=1: LightB.State=2
If LightA.State=1 and LightB.State=1 and LightC.State=1 and LightD.State=1 and Light10.State=1 then Light11.State=1:If B2SOn Then Controller.B2SSetData 84,1
If LightA.State=1 and LightB.State=1 and LightC.State=1 and LightD.State=1 and Light9.State=1 then Light10.State=1:If B2SOn Then Controller.B2SSetData 83,1
If Light10.State=1 then Light7.State=1
If Light11.State=1 then Light7.State=1
If LightA.State=1 and LightB.State=1 and LightC.State=1 and LightD.State=1 and Light8.State=1 then Light9.State=1:If B2SOn Then Controller.B2SSetData 82,1
If LightA.State=1 and LightB.State=1 and LightC.State=1 and LightD.State=1 then Light8.State=1:If B2SOn Then Controller.B2SSetData 81,1
If LightA.State=1 and LightB.State=1 and LightC.State=1 and LightD.State=1 and Light8.State=1 and Light9.State=1 and Light10.State=1 and LightD.State=1 then
credit=credit+1
qs=qs+2
playsound "knocke"
if credit>25 then credit=25
If B2SOn Then
Controller.B2SSetCredits Credit
end if
End If
If LightA.State=1 and LightB.State=1 and LightC.State=1 and LightD.State=1 then
LightA.State=2
LightB.State=0
LightC.State=0
LightD.State=0
End If
End Sub
Sub LeftSlingShot1_Slingshot()
Addscore 10
flipopen
End Sub
Sub LeftSlingShot2_Slingshot()
Addscore 10
End Sub
Sub LeftSlingShot3_Slingshot()
Addscore 10
End Sub
Sub LeftSlingShot4_Slingshot()
Addscore 10
End Sub
Sub RughtSlingShot1_Slingshot()
Addscore 10
flipopen
End Sub
Sub RughtSlingShot2_Slingshot()
Addscore 10
End Sub
sub ballrel_hit
if ballrelenabled=1 then
playsound "launchball"
ballrelenabled=0
end if
End Sub
sub flipclose
if tilt=false then
if (rflip.visible)=false then
playsoundAtVol "zclose", RightFlipper, 1
playsoundAtVol "zclose", LeftFlipper, 1
rflip.visible=false
rflip1.visible=true
lflip.visible=false
lflip1.visible=true
LeftFlipper.enabled=false
leftflipper1.enabled=true
RightFlipper.enabled=false
rightflipper1.enabled=true
end if
end if
End Sub
sub flipopen
if (rflip.visible)=true then
playsoundAtVol "zopen", LeftFlipper, 1
playsoundAtVol "zopen", RightFlipper, 1
rflip.visible=true
rflip1.visible=false
lflip.visible=true
lflip1.visible=false
leftflipper.enabled=true
leftflipper1.enabled=false
rightflipper.enabled=true
rightflipper1.enabled=false
End if
End Sub
sub savehs
' Based on Black's Highscore routines
Dim FileObj
Dim ScoreFile
Set FileObj=CreateObject("Scripting.FileSystemObject")
If Not FileObj.FolderExists(UserDirectory) then
Exit Sub
End if
Set ScoreFile=FileObj.CreateTextFile(UserDirectory & "4-Queens.txt",True)
ScoreFile.WriteLine score
scorefile.writeline credit
scorefile.writeline matchnumb
scorefile.writeline hisc
scorefile.writeline wv
scorefile.writeline qs
ScoreFile.Close
Set ScoreFile=Nothing
Set FileObj=Nothing
End Sub
sub loadhs
' Based on Black's Highscore routines
Dim FileObj
Dim ScoreFile
dim temp1
dim temp2
dim temp3
dim temp4
dim temp5
dim temp6
Set FileObj=CreateObject("Scripting.FileSystemObject")
If Not FileObj.FolderExists(UserDirectory) then
Exit Sub
End if
If Not FileObj.FileExists(UserDirectory & "4-Queens.txt") then
Exit Sub
End if
Set ScoreFile=FileObj.GetFile(UserDirectory & "4-Queens.txt")
Set TextStr=ScoreFile.OpenAsTextStream(1,0)
If (TextStr.AtEndOfStream=True) then
Exit Sub
End if
temp1=TextStr.ReadLine
temp2=textstr.readline
temp3=textstr.readline
temp4=Textstr.ReadLine
temp5=Textstr.ReadLine
temp6=Textstr.ReadLine
TextStr.Close
score = CDbl(temp1)
credit= CDbl(temp2)
matchnumb= CDbl(temp3)
hisc=cdbl(temp4)
wv=cdbl(temp5)
qs=cdbl(temp6)
Set ScoreFile=Nothing
Set FileObj=Nothing
End Sub
'************************************************
'************************************************
'************************************************
'************************************************
'************************************************
'**********Sling Shot Animations
' Rstep and Lstep are the variables that increment the animation
'****************
Dim RStep, Lstep
Sub RightSlingShot_Slingshot
PlaySoundAtVol "right_slingshot", sling1, 1
RSling.Visible = 0
RSling1.Visible = 1
sling1.TransZ = -20
RStep = 0
RightSlingShot.TimerEnabled = 1
Addscore 10
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