-
Notifications
You must be signed in to change notification settings - Fork 37
/
Contest (Gottlieb 1958) 52 Final 1.5.vbs
2174 lines (1934 loc) · 51.2 KB
/
Contest (Gottlieb 1958) 52 Final 1.5.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
Const cGameName = "contest_1958"
Const ReflectionMod=True 'enable JPJ reflection mod
' Thalamus 2018-07-20
' Added/Updated "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
' Thalamus 2018-08-09 : 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 )
' The rest of the values are multipliers
'
' .5 = lower volume
' 1.5 = higher volume
Const VolBump = 2 ' Bumpers volume.
Const VolGates = 1 ' Gates volume.
Const VolMetal = 1 ' Metals volume.
Const VolRH = 1 ' Rubber hits volume.
Const VolKick = 1 ' Kicker volume.
Const VolFlip = 1 ' Flipper volume.
Dim Score(4)
dim truesc(4)
dim ballrelenabled
dim activeballs
dim state
dim playno
dim credit
dim eg
dim currpl
dim play(4)
dim rst
dim ballinplay
dim tilt
dim tiltsens
dim rep(4)
dim plm(4)
dim matchnumb
dim cred
dim scn
dim scn1
dim scn2
dim scn3
dim points
dim tempscore
dim replay1
dim replay2
dim replay3
dim replay4
dim hisc
dim pltilt(4)
dim motion
dim rv
dim rt
dim rt1
dim tt
dim rsv 'Rotor initial score value without multiply
dim ylv
dim rstep, rstepb, rstepc, rstepd, rstepe, lstep, lstepb, lstepc, lstepd, lstepe
dim BallRadius, BallMass, cball1
dim LaunchBall
dim automatic
dim rotorR, rotation
dim wheelprice
dim c, a
dim EMR(4)
dim GL, bumpT, bumpB 'state of gi left and right and high bumper states
DIM HZ 'Hit Zone for the gates to provide double hits
dim b2svarlightA, b2svarlightB, b2sSunL, b2sSunR
Dim GlobalSoundLevel 'Diner's Method for amplify mechanical sounds, thanks to them :
GlobalSoundLevel = 2
GL="L"
bumpT=0
bumpB=0
credit = 0
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
sub table1_init
LoadEM
If ShowDT=false Then
for each obj in DTItems
obj.visible=False
Next
Primitive78.visible = 0
Primitive77.visible = 0
Primitive81.visible = 0
Primitive82.visible = 0
Primitive83.visible = 0
Primitive84.visible = 0
RampLBlack.visible = 1
RampRBlack.visible = 1
RampLBlack1.visible = 1
RampRBlack1.visible = 1
Else
RampLBlack.visible = 0
RampRBlack.visible = 0
RampLBlack1.visible = 0
RampRBlack1.visible = 0
end If
'***********************************************************************
'*** Automatic launch ball or not, if not use the RightMagnaSave Key ***
'*** 0 = RightMagnaSave Key - 1 = automatic ***
'***********************************************************************
automatic = 1 '***
'***********************************************************************
'***********************************************************************
Scoreb2s.enabled = 1 '*** Activation of the Score sync on the b2s **
'***********************************************************************
set EMR(1)=score1
set EMR(2)=score2
set EMR(3)=score3
set EMR(4)=score4
if credit="" then
credit=0
end If
credittxt.text=credit
If credit > 0 Then DOF 119, DOFOn
GL="L"
GILeft.enabled = 1
BallRadius = 25
BallMass = 2.5
bouton01.z=2.5
bouton01f.z=2.5
bouton02.z=2.5
bouton02f.z=2.5
bouton03.z=2.5
bouton03f.z=2.5
rotorR=Wheel.objroty
Wheelprice = 10
c=0
randomize
replay1=995
replay2=1300
replay3=1700
replay4=1850
r1.text=replay1
r2.text=replay2
r3.text=replay3
r4.text=replay4
for each obj in droppers
obj.isdropped=true
next
loadhs
if hisc="" then hisc=1000
hstxt.text=hisc
if credit="" then credit=0
credittxt.text=credit
if B2SOn then
Scoreb2s.enabled =1
end If
if matchnumb="" then matchnumb=int(rnd(1)*9)
match(matchnumb).text=matchnumb
for i=0 to 3
currpl=i
reel(i).setvalue(score(i))
if score(i)>9999 then threel(i).setvalue(1)
next
currpl=0
cred=0
credtimer.enabled=true
if rv="" then rv=0
if ylv="" then ylv=0
ylupdate
AutomaticBallLaunch.enabled=True
'************************************************************
'*** B2S ***
'************************************************************
If B2SOn Then
for i=0 to 3
Controller.B2SSetScore i, Score(i)
next
End If
HZ = 0
Ballinplay = 0
b2svarlightA=1
b2svarlightB=2
b2svar1.enabled = 1
b2svar2.enabled = 1
SunL.enabled = 1
b2sSunL=1
b2sSunR=1
if motion=0 and tilt=false and c=0 then
rt=(int(rnd(1)*8)+4)
motion=1
c=1
a=int((rnd*6)+1)
rotort.enabled=true
end if
end sub
'******** end of table ini *********
Sub Table1_KeyDown(ByVal keycode)
If keycode = PlungerKey Then
Plunger.PullBack
End If
if keycode = AddCreditKey then
playsoundAtVol "coin3", drain, 1
coindelay.enabled=true
end if
if keycode = StartGameKey and credit>0 and state=false and playno=0 then
credit=credit-1
If credit < 1 Then DOF 119, DOFOff
credittxt.text=credit
eg=0
playno=1
currpl=0
activeballs=0
tilt=false
tilttxt.text=" "
bumper1.force=5
bumper2.force=5
tiltseq.stopplay
for each obj in indtilt
obj.text=" "
next
gamov.text="GAME OVER"
playup(currpl).setvalue(1)
player.setvalue(1)
playsound "click"
rst=0
playsound "initialize"
resettimer.enabled=true
if B2SOn then Scoreb2s.enabled =1
end if
if keycode = StartGameKey and credit>0 and state=true and playno>0 and playno<4 and ballinplay<2 then
credit=credit-1
If credit < 1 Then DOF 119, DOFOff
credittxt.text=credit
player.addvalue(1)
playno=playno+1
playsound "click"
if B2SOn then Scoreb2s.enabled =1
End If
if automatic = 0 and keycode = RightMagnaSave and activeballs=0 and state=true and ballinplay<6 then
activeballs=activeballs+1
nb.CreateSizedballWithMass BallRadius,BallMass 'old nb.createball
nb.kick 270,10
playsoundAtVol SoundFXDOF("ballout",115,DOFPulse,DOFContactors), nb, VolKick
end if
if tilt=false and state=true then
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToEnd
Flipper1.RotateToEnd
PlaySoundAtVol SoundFXDOF("FlipperUp",101,DOFOn,DOFFlippers), LeftFlipper, VolFlip
PlaySoundAtVol "FlipperUp", Flipper1, VolFlip
playsoundAtVol "buzz", LeftFlipper, VolFlip
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToEnd
Flipper2.RotateToEnd
PlaySoundAtVol SoundFXDOF("FlipperUp",102,DOFOn,DOFFlippers), RightFlipper, VolFlip
PlaySoundAtVol "FlipperUp", Flipper2, VolFlip
playsoundAtVol "buzz1", RightFlipper, VolFlip
End If
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 Sub
Sub Table1_KeyUp(ByVal keycode)
If keycode = PlungerKey Then
Plunger.Fire
playsoundAtVol "plunger", plunger, 1
End If
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToStart
Flipper1.RotateToStart
if state=true and tilt=false then PlaySoundAtVol SoundFXDOF("FlipperDown",101,DOFOff,DOFFlippers), LeftFlipper, VolFlip
if state=true and tilt=false then PlaySoundAtVol "FlipperDown", Flipper1, VolFlip
stopsound "buzz"
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToStart
Flipper2.RotateToStart
if state=true and tilt=false then PlaySoundAtVol SoundFXDOF("FlipperDown",102,DOFOff,DOFFlippers), RightFlipper, VolFlip
if state=true and tilt=false then PlaySoundAtVol "FlipperDown", Flipper2, VolFlip
stopsound "buzz1"
End If
End Sub
sub AutomaticBallLaunch_Timer
if automatic = 1 and activeballs=0 and state=true and ballinplay<6 then
activeballs=activeballs+1
nb.CreateSizedballWithMass BallRadius,BallMass
nb.kick 270,10
DOF 115, DOFPulse
end if
End Sub
sub coindelay_timer
playsound "click"
credit=credit+1
DOF 119, DOFOn
credittxt.text=credit
coindelay.enabled=false
if B2SOn then Scoreb2s.enabled =1
end sub
sub resettimer_timer
rst=rst+1
if rst=6 or rst=12 or rst=1 then
tiltseq.play seqalloff
playsound "clerker"
for each obj in plast
obj.isdropped=true
next
end if
if rst=7 or rst=13 or rst=2 then
tiltseq.stopplay
playsound "relay"
ylv=ylv+1
if ylv>4 then ylv=0
ylupdate
for each obj in plast
obj.isdropped=false
next
end if
for i=0 to 3
reel(i).resettozero
next
if rst=14 then
playsound "kickerkick"
end if
ylv=ylv+1
if ylv>4 then ylv=0
ylupdate
if rst=18 then
newgame
resettimer.enabled=false
end if
end sub
sub addscore(points)
if tilt=false then
bell=0
if points=10 or points=1 then
matchnumb=matchnumb+1
if matchnumb=10 then matchnumb=0
end if
if points = 100 then
reel(currpl).addvalue(100)
playsound SoundFXDOF("gigibump4loud",142,DOFPulse,DOFChimes)
end if
if points = 10 then
reel(currpl).addvalue(10)
playsound SoundFXDOF("gigibump3loud",141,DOFPulse,DOFChimes)
end if
if points = 1 then
reel(currpl).addvalue(1)
ylv=ylv+1
if ylv>4 then ylv=0
ylupdate
end if
if points = 5 then
playsound "motorshort1s"
reel(currpl).addvalue(5)
end if
if points = 20 then
reel(currpl).addvalue(20)
scn=2
scn1=0
playsound "motorshort1s"
scntimer.enabled=true
end if
if points = 30 then
reel(currpl).addvalue(30)
scn=3
scn1=0
playsound "motorshort1s"
scntimer.enabled=true
end if
if points = 40 then
reel(currpl).addvalue(40)
scn=4
scn1=0
playsound "motorshort1s"
scntimer.enabled=true
end if
if points = 50 then
reel(currpl).addvalue(50)
scn=5
scn1=0
playsound "motorshort1s"
scntimer.enabled=true
end if
if points = 200 then
reel(currpl).addvalue(200)
scn2=2
scn3=0
playsound "motorshort1s"
scntimer1.enabled=true
end if
if points = 300 then
reel(currpl).addvalue(300)
scn2=3
scn3=0
playsound "motorshort1s"
scntimer1.enabled=true
end if
if points = 400 then
reel(currpl).addvalue(400)
scn2=4
scn3=0
playsound "motorshort1s"
scntimer1.enabled=true
end if
if points = 500 then
reel(currpl).addvalue(500)
scn2=5
scn3=0
playsound "motorshort1s"
scntimer1.enabled=true
end if
score(currpl)=score(currpl)+points
truesc(currpl)=truesc(currpl)+points
'if truesc(currpl)>1999 then exsc(currpl).text=truesc(currpl)
if score(currpl)>9999 then threel(currpl).setvalue(1)
' if score(currpl)>1999 then
' score(currpl)=score(currpl)-1000
' rep(currpl)=0
' end if
if score(currpl)=>replay1 and rep(currpl)=0 then
credit=credit+1
DOF 119, DOFOn
playsound SoundFXDOF("knocke",117,DOFPulse,DOFKnocker)
DOF 118, DOFPulse
credittxt.text=credit
rep(currpl)=1
playsound "click"
if B2SOn then Scoreb2s.enabled =1
end if
if score(currpl)=>replay2 and rep(currpl)=1 then
credit=credit+1
DOF 119, DOFOn
playsound SoundFXDOF("knocke",117,DOFPulse,DOFKnocker)
DOF 118, DOFPulse
credittxt.text=credit
rep(currpl)=2
playsound "click"
if B2SOn then Scoreb2s.enabled =1
End if
if score(currpl)=>replay3 and rep(currpl)=2 then
credit=credit+1
DOF 119, DOFOn
playsound SoundFXDOF("knocke",117,DOFPulse,DOFKnocker)
DOF 118, DOFPulse
credittxt.text=credit
rep(currpl)=3
playsound "click"
if B2SOn then Scoreb2s.enabled =1
end if
if score(currpl)=>replay4 and rep(currpl)=3 then
credit=credit+1
DOF 119, DOFOn
playsound SoundFXDOF("knocke",117,DOFPulse,DOFKnocker)
DOF 118, DOFPulse
credittxt.text=credit
rep(currpl)=4
playsound "click"
if B2SOn then Scoreb2s.enabled =1
end if
end if
end sub
sub scntimer_timer
scn1=scn1 + 1
playsound SoundFXDOF("gigibump3loud",141,DOFPulse,DOFChimes)
if scn1=scn then scntimer.enabled=false
end sub
sub scntimer1_timer
scn3=scn3 + 1
playsound SoundFXDOF("gigibump4loud",142,DOFPulse,DOFChimes)
if scn2=scn3 then scntimer1.enabled=false
end sub
sub matchnum
match(matchnumb).text=matchnumb
for i=1 to playno
if matchnumb=(score(i-1) mod 10) then
credit=credit+1
DOF 119, DOFOn
playsound SoundFXDOF("knocke",117,DOFPulse,DOFKnocker)
DOF 118, DOFPulse
credittxt.text= credit
playsound "click"
end if
next
playno=0
end sub
Sub CheckTilt
If Tilttimer.Enabled = True Then
TiltSens = TiltSens + 1
if TiltSens = 2 Then
Tilt = True
tilttxt.text="TILT"
tiltsens = 0
pltilt(currpl)=1
indtilt(currpl).text="TILT"
playsound "tilt"
turnoff
End If
Else
TiltSens = 0
Tilttimer.Enabled = True
End If
End Sub
Sub MechCheckTilt
Tilt = True
tilttxt.text="TILT"
tiltsens = 0
pltilt(currpl)=1
indtilt(currpl).text="TILT"
playsound "tilt"
turnoff
LeftFlipper.RotateToStart
RightFlipper.RotateToStart
End Sub
Sub Tilttimer_Timer()
Tilttimer.Enabled = False
End Sub
sub turnoff
bumper1.force=0
bumper2.force=0
tiltseq.play seqalloff
for each obj in match
obj.text=" "
next
playup(currpl).setvalue(0)
player.setvalue(0)
for each obj in ballplay
obj.text=" "
next
for each obj in GIGEN
obj.state=0
Next
for each obj in GIR
obj.state=0
Next
for each obj in GIL
obj.state=0
Next
currpl=0
ballinplay=0
end sub
sub newgame
credtimer.enabled=false
credtxt.text="Ported To VP By Leon Spalding, Ported To VPX by Team PP, JPJ, Chucky"
state=true
eg=0
for i=0 to 3
score(i)=0
truesc(i)=0
rep(i)=0
pltilt(i)=0
threel(i).setvalue(0)
next
bumper1.force=5
bumper2.force=5
for each obj in GIGEN
obj.state=1
Next
' for each obj in lights
' obj.state=0
' next
on1.state=1
off2.state=1
light3.state=1:light3z.state=1
light4.state=1:light4z.state=1
light5.state=1:light5z.state=1
if motion=0 then
rt=(int(rnd(1)*8)+4)
motion=1
rotort.enabled=true
end if
bip5.text=" "
bip1.text="1"
for i=0 to 9
match(i).text=" "
next
tilttxt.text=" "
gamov.text=" "
tilt=false
tiltsens=0
ballinplay=1
playsound "reset1"
if B2SOn then Scoreb2s.enabled =1
end sub
Sub Drain_Hit()
playsoundAtVol "drainshort", drain, 1
DOF 116, DOFPulse
Drain.DestroyBall
if ballinplay<5 then playsound "motorshort"
activeballs=activeballs-1
if activeballs=0 then tt=0:nextball
if B2SOn then Scoreb2s.enabled =1
End Sub
sub nextball
if ballinplay<5 and tilt=false then playsound "motorshorter1s"
for i=0 to 4
if pltilt(i)=1 then tt=tt+1
next
for each obj in GIGEN
obj.state=1
Next
if tt=playno then
for i=0 to 4
ballplay(i).text=" "
next
currpl=currpl+1
state=false
savehs
playno=0
'ballreltimer.enabled=true
exit sub
end if
if tilt=true then
tilt=false
tilttxt.text=" "
bumper1.force=6
bumper2.force=6
tiltseq.stopplay
ballplay(ballinplay).text=ballinplay
player.setvalue(playno)
end if
currpl=currpl+1
if currpl>playno-1 then
ballinplay=ballinplay+1
playsound "relay"
if ballinplay>5 then
playsound "motorleer"
ballreltimer.enabled=true
else
if state=true and tilt=false then
playup(currpl-1).setvalue(0)
currpl=0
playup(currpl).setvalue(1)
playsound "relay"
tilttxt.text=" "
end if
select case ballinplay
case 0:
bip1.text=" "
bip2.text=" "
bip3.text=" "
bip4.text=" "
bip5.text=" "
case 1:
bip1.text="1"
bip2.text=" "
bip3.text=" "
bip4.text=" "
bip5.text=" "
case 2:
bip1.text=" "
bip2.text="2"
bip3.text=" "
bip4.text=" "
bip5.text=" "
case 3:
bip1.text=" "
bip2.text=" "
bip3.text="3"
bip4.text=" "
bip5.text=" "
case 4:
bip1.text=" "
bip2.text=" "
bip3.text=" "
bip4.text="4"
bip5.text=" "
case 5:
bip1.text=" "
bip2.text=" "
bip3.text=" "
bip4.text=" "
bip5.text="5"
end select
playsound "relay"
end if
end if
if currpl>0 and currpl<(playno) then
if state=true and tilt=false then
playup(currpl-1).setvalue(0)
playup(currpl).setvalue(1)
playsound "relay"
tilttxt.text=" "
end if
end if
if pltilt(currpl)=1 then tilttxt.text="TILT":tt=0:nextball
end Sub
sub ballreltimer_timer
if tilt=false then matchnum
bip5.text=" "
state=false
for i=0 to 3
if truesc(i)>hisc then
hisc=truesc(i)
hstxt.text=hisc
end if
next
playup(currpl-1).setvalue(0)
player.setvalue(0)
gamov.text="GAME OVER"
savehs
cred=0
credtimer.enabled=true
if ballinplay > 5 then ballinplay = 0
ballreltimer.enabled=false
end sub
'**********************************************
'** New wheel part jpj **
'**********************************************
sub rotort_timer()
rotorR = Wheel.objroty
playsound SoundFXDOF("lightmotor",120,DOFOn,DOFGear)
rotationW.enabled=True
rt1=rt1+1
' rotoradv mis à la fin
if rt1=rt*2 then
rt1=0
motion=0
ylupdate
end If
if rsv<40 then
l400.state=0:l400z.state=0
l500.state=0:l500z.state=0
end if
end sub
sub rotationW_timer
select case c
case 1 :
Wheel.objroty = Wheel.objroty + 9
if wheel.objroty = 360 then wheel.objroty = 0:end If
c=2
case 2 :
Wheel.objroty = Wheel.objroty + 9
if wheel.objroty = 360 then wheel.objroty = 0:end If
c=3
case 3 :
Wheel.objroty = Wheel.objroty + 9
if wheel.objroty = 360 then wheel.objroty = 0:end If
c=4
case 4 :
Wheel.objroty = Wheel.objroty + 9
if wheel.objroty = 360 then wheel.objroty = 0:end If
a=a-1
if a >0 then
c=1
Else
if a=0 then c=5
rotoradv
end If
case 5 :
Wheel.objroty = Wheel.objroty + 25
c=6
case 6 :
Wheel.objroty = Wheel.objroty + 10
c=7
case 7 :
Wheel.objroty = Wheel.objroty + 5
c=8
case 8 :
Wheel.objroty = Wheel.objroty +2
c=9
case 9 :
Wheel.objroty = Wheel.objroty - 7
c=10
case 10 :
Wheel.objroty = Wheel.objroty -46
c=11
case 11 :
Wheel.objroty = Wheel.objroty +11
c=0:rotationW.enabled=false:DOF 120, DOFOff
end Select
motion=0 and tilt=false
rotort.enabled=false
if c=0 then rotationW.enabled=false:DOF 120, DOFOff:end if
end Sub
'*************************************************
'************** Slingshots ***********************
Sub RightSlingShot_Slingshot
playsoundAtVol SoundFXDOF("rightslingshot",104,DOFPulse,DOFContactors), slingR, 1
DOF 106, DOFPulse
if GI1.state=1 then
addscore 10
else
addscore 1
end if
if GL = "L" then
GL = "R"
Else
GL = "L"
end if
RSling.Visible = 0
RSling1.Visible = 1
slingR.objroty = -15
RStep = 2
RightSlingShot.TimerEnabled = 1
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:b2sSunR=b2sSunR+1
End Select
RStep = RStep + 1
End Sub
Sub LeftSlingShot_Slingshot
playsoundAtVol SoundFXDOF("leftslingshot",103,DOFPulse,DOFContactors), slingL, 1
DOF 105, DOFPulse
if GI01.state=1 then
addscore 10
else
addscore 1
end if
if GL = "L" then
GL = "R"
Else
GL = "L"
end if
LSling.Visible = 0
LSling1.Visible = 1
slingL.objroty = 15
LStep = 2
LeftSlingShot.TimerEnabled = 1
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:b2sSunL=b2sSunL+1
End Select
LStep = LStep + 1
End Sub
Sub LeftSlingShotb_Slingshot
playsoundAtVol SoundFX("leftslingshot",DOFcontactors), slingLb, 1
DOF 124, DOFPulse
addscore 1
if GL = "L" then
GL = "R"
Else
GL = "L"
end if
LSlingb.Visible = 0
LSlingb1.Visible = 1
slingLb.objroty = 15
LStepb = 2
LeftSlingShotb.TimerEnabled = 1
End Sub
Sub LeftSlingShotb_Timer()
Select Case LStepb
Case 3:LSLingb1.Visible = 0:LSLingb2.Visible = 1:slingLb.objroty = 7
Case 4:slingLb.objroty = 0:LSLingb2.Visible = 0:LSLingb.Visible = 1:LeftSlingShotb.TimerEnabled = 0:b2sSunL=b2sSunL+1
End Select
LStepb = LStepb + 1
End Sub
Sub LeftSlingShotc_Slingshot
playsoundAtVol SoundFX("leftslingshot",DOFcontactors), slingLc, 1
DOF 122, DOFPulse
addscore 5
if motion=0 and tilt=false and c=0 then
rt=(int(rnd(1)*8)+4)
motion=1
c=1
a=int((rnd*6)+1)
rotort.enabled=true
end if
if GL = "L" then
GL = "R"
Else
GL = "L"
end if
LSlingc.Visible = 0
LSlingc1.Visible = 1
slingLc.objroty = 15
LStepc = 2
LeftSlingShotc.TimerEnabled = 1
End Sub
Sub LeftSlingShotc_Timer()
Select Case LStepc
Case 3:LSLingc1.Visible = 0:LSLingc2.Visible = 1:slingLc.objroty = 7
Case 4:slingLc.objroty = 0:LSLingc2.Visible = 0:LSLingc.Visible = 1:LeftSlingShotc.TimerEnabled = 0:b2sSunL=b2sSunL+1
End Select
LStepc = LStepc + 1
End Sub
Sub LeftSlingShotd_Slingshot
playsoundAtVol SoundFX("leftslingshot",DOFContactors), slingLd, 1
DOF 120, DOFPulse
addscore 1
if GL = "L" then
GL = "R"
Else
GL = "L"