-
Notifications
You must be signed in to change notification settings - Fork 0
/
beta-0.0.2.bas
1322 lines (1152 loc) · 47 KB
/
beta-0.0.2.bas
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
'Copyright 2023 Stefano Cirilli
'Licensed under the Apache License, Version 2.0 (the "License");
'you may not use this file except in compliance with the License.
'You may obtain a copy of the License at
' http://www.apache.org/licenses/LICENSE-2.0
'Unless required by applicable law or agreed to in writing, software
'distributed under the License is distributed on an "AS IS" BASIS,
'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
'See the License for the specific language governing permissions and
'limitations under the License.
'----------------------------------------------- CREDITS --------------------------------------------------------------------
'Thanks to Ted Felix, the Sprites' wizard;to logiclrd for his faq "Delays and timing in Quickbasic";to RetroNick for his tutorial about collision in qbasic; to Toshi's Project Page;
'to Pete's qbasic site and last, but not least, to all the community of freethinkers.
'-----------------------------------------------------------------------------------------------------------------------------
#lang "fblite"
#include "delay_regulate_framerate.bi"
#include "crt.bi"
#include once "windows.bi"
'#include "fbgfx.bi"
#if __FB_LANG__ = "fb"
'Using FB '' Screen mode flags are in the FB namespace in lang FB
#endif
#define pi ( atn(1) * 4 )
#define radian(x) ( (x) * pi / 180 )
#define degree(x) ( (x) * 180 / pi )
'Sprite1
Data 1,1,1,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,1,1,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,1,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,1,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,1,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,1,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,6,1,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1
Data 1,1,1,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1
Data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
Data 1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1
Data 1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1
Data 1,1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,1
Data 1,7,3,7,3,3,7,3,7,3,3,7,3,3,3,7,3,3,7,1
Data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
'-----------------------------------------------------------------------------------
'Sprite2
Data 1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1
Data 1,1,1,2,2,2,2,2,2,2,2,2,1,1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1,1,1,1,1,1,1,1,1,1,1,1,3
'----------------------------Subs' Declarations-------------------------------------------
Const NULLA As Any Ptr = 0
declare sub rbound()
declare SUB PlotLine (x1 AS INTEGER, y1 AS INTEGER, x2 AS INTEGER, y2 AS INTEGER, colore AS INTEGER)
declare Function Arrotonda (Num!, Decimals%)
declare Sub PUT2 (Sprites() As Integer, XSize As Integer, YSize As Integer, X As Integer, Y As Integer)
declare Sub Switch (x, y)
declare Function CircleRect (circle_x, circle_y, circle_rad, r1x, r1y, r1w, r1h)
declare Function rectRect% (r1x%, r1y%, r1w%, r1h%, r2x%, r2y%, r2w%, r2h%)
declare Function rectRect2 (r1x, r1y, r1w, r1h, r2x, r2y, r2w, r2h)
declare function findDistance(ox as single, oy as single, dx as single, dy as single)
declare Function bmp_load( ByRef filename As Const String ) As Any Ptr
'Sub delay (numSeconds#, frequency#)
'numTicks& = numSeconds# * frequency#
'For i& = 1 To numTicks&
'st# = Timer
'While st# = Timer: Wend
'Next i&
'End Sub
'-----------------------------End of subs' declarations---------------------------------------------------------
Type coppiaXY
x As Integer
y As Integer
End Type
declare sub p2pvector(p1 as coppiaXY, p2 as coppiaXY, vec as coppiaXY)
Type timoneType
location As coppiaXY
angolo As Single
End Type
Type spriteType
location As coppiaXY
wid As Integer
hei As Integer
ventoadx as boolean
ventoasx as boolean
End Type
type andaturaType
bolina as boolean
poppa as boolean
ventoadx as integer
ventoasx as integer
sottovento as boolean
sopravvento as boolean
angolo as single
end type
Type shipType
accelerazione as single
sailarea as integer
weight as integer
andatura as andaturaType
vmg as single
timone as timoneType
end type
Type boatype
location as coppiaXY
radius As Integer
End Type
Type playerType
num As Integer
kright As Integer
kleft As Integer
kup As Integer
kdown As Integer
ship as shipType
spirit As spriteType
penalty As Integer
End Type
Type windtype
direzione As Single
forza As Single
velocita As Single
End Type
dim shared map(40,24) as integer
dim shared as short shorty
dim shared andatura as andaturatype
'dim shared ship(2) as shipType
Dim Shared boa(2) As boatype
Dim Shared spirit(2) As spriteType
Dim Shared wind As windtype
Dim Shared barra(2) As timoneType
dim shared player(2) as playerType
Dim shared barca(19,25) as integer
Dim shared barca1(19,25) as integer
Dim shared barca2(19,25) as integer
Dim shared barca3(19,25) as integer
'dim shared as single PI
dim shared as single tx,ty
Dim As Ulong FPS = 60
Dim shared Mask%(19, 25)
'dim shared tileblu(19,25) as TileType
'dim shared tilecyan(19,25) as TileType
Dim c!(360), s!(360)
dim s$(9)
dim shared Pascalbar!
dim as any ptr img
dim as any ptr img1
'dim shared accelerazione!
dim shared angolodibolina!(2)
dim angolodipoppa(2) as single
dim shared der(2) as single
dim as string ws = "Wind too strong to navigate"
dim shared as single t0=150
dim as integer lastx, lasty, lastw, lasth, lastx1, lasty2, lastw2, lasth2, SX, SY, S1X, S1Y, SX3, SY3, SX4, SY4, accrefresh
dim as integer rx = 0
dim as integer ry = 0
dim as integer rw = 799
dim as integer rh = 599
dim d, d1, d2 as single
dim as HWND hwnd=GetConsoleWindow 'Win2k or newer
dim shared counter(4) as integer
dim shared as boolean overlap
dim shared as integer trigger
dim shared as single tempo, tempolimite
dim shared as single angle(2)
'------------------- Intro screen -------------------------------------
'-------------------------------------------------------------------------------------------
'***** ++++** * ******* ** * * * *
'* * * * * * * * * * * * *
'****** * * * * * * * * * ****
'* * * * ******* * * * * * * *
'****** ****** * * * * * * * *
'-----------------------------------------------------------------------------------------
ShowWindow(hwnd,SW_HIDE)
WindowTitle "BOATNIK"
s$(1) = "***** ****** * ******* ** * * * *"
s$(2) = "* * * * * * * * * * * * * "
s$(3) = "****** * * * * * * * * * **** "
s$(4) = "* * * * ******* * * * * * * * "
s$(5) = "****** ****** * * * * * * * *"
s$(6) = "---------------------------------------------------------------------"
s$(7) = "A joke about a regatta-like game"
s$(8) = " "
s$(9) = "A program written by Stefano Cirilli - 2023 [email protected]"
Screen 20, 8, 2 ', FB.GFX_FULLSCREEN
'screenres 800,600
' 19
For i = 1 To 9
Locate 20 + i, (120 - Len(s$(i))) / 2
Print s$(i)
Next i
sleep
color 10,1
cls
'PI!=3.14159
'------------------------ End of intro screen ----------------------------------
'------------Reading sprites------------------------
For Z = 0 To 25
For j = 0 To 19
Read barca(j, Z)
'Pset (10 + j, 230 + Z), barca(j,z)
Next j
Next Z
For Z = 0 To 25
For j = 0 To 19
Read barca1(j, Z)
'Pset (10 + j, 270 + Z), barca1(j,z)
next j
Next Z
For Z = 0 To 25
For j = 0 To 19
Read barca2(j, Z)
'Pset (10 + j, 270 + Z), barca1(j,z)
next j
Next Z
For Z = 0 To 25
For j = 0 To 19
Read barca3(j, Z)
'Pset (10 + j, 270 + Z), barca1(j,z)
next j
Next Z
'Reading data from the mask
For Z = 0 To 25
For j = 0 To 19
Read Mask%(j, Z)
Next j
Next Z
'End of mask
For Y = 0 To 23 ' This little routine reads the DATA
For X = 0 To 39 ' into the map array. We will use
Read map(X, Y) ' this DATA to draw the map and test
Next X ' where the player can and can't
Next Y ' move.
bload( "tiles/tile04.bmp" ), img
'img = bmp_load( "tiles\tile05.bmp" )
'bload("tiles/cup.bmp"),img
'bload( "tiles/tile01.bmp" ), img1
For Y = 0 To 23
For X = 0 To 39
If map(X, Y) = 0 Then
Put (X * 20, Y * 25), img, PSet
ElseIf map(X, Y) = 1 Then
Put (X * 20, Y * 25), img, PSet
ElseIf map(X, Y) = 2 Then
Put (X * 20, Y * 25), img, PSet
End If
Next X
Next Y
'------------End of sprites--------------------------
' ----------- Fundamental physics -------------------
'------------------------------------------------------
'
'Putting all of sine and cosine values into two arrays
For i = 1 To 360
c!(i) = Cos(i * 3.14 / 180)
s!(i) = Sin(i * 3.14 / 180)
Next
'------------ End of sine and cosine table --------------------------------
'
'------------------Variables declaration -----------------------------------
wind.direzione = 15 'Wind's direction
Randomize Timer
r = Int(Rnd * 10 + 6)
'r = 8
wind.forza = r
select case r
case 6
player(1).ship.sailarea = 42
player(2).ship.sailarea = 42
case 7
player(1).ship.sailarea = 32
player(2).ship.sailarea = 32
case 8
player(1).ship.sailarea = 25
player(2).ship.sailarea = 25
case 9
player(1).ship.sailarea = 20
player(2).ship.sailarea = 20
case 10
player(1).ship.sailarea = 20
player(2).ship.sailarea = 20
case 11
player(1).ship.sailarea = 20
player(2).ship.sailarea = 20
case 12
player(1).ship.sailarea = 20
player(2).ship.sailarea = 20
case 13
player(1).ship.sailarea = 20
player(2).ship.sailarea = 20
case 14
player(1).ship.sailarea = 19
player(2).ship.sailarea = 19
case 15
player(1).ship.sailarea = 16
player(2).ship.sailarea = 16
case else
player(1).ship.sailarea = 20
player(2).ship.sailarea = 20
end select
if r > 15 then
print(ws)
sleep
end
elseif r < 6 then
print "wind too low to navigate"
sleep
end
end if
wind.velocita = .5 * wind.forza
'ship.sailarea = 20
'REM La riga seguente calcola la pressione del vento sulla vela x mq
Pascalbar! = (wind.velocita ^ 2) * .613
Rem F=m*a quindi a=F/m
'player(1).ship.accelerazione = Arrotonda((Pascalbar! * player(1).ship.sailarea) / 154,2)
'+player(2).ship.accelerazione = Arrotonda((Pascalbar! * player(2).ship.sailarea) / 154,2)
'--------------A bit of fric tion to slow the program, it simulates waves----------------------------
friction!=.85
'-----------End of friction----------------------------
PointScale = 128
'freq# = setupTimer#(18.4) 'Setup timing
'screenres 800,600
'------Draws wind's direction--------------
Circle (890, 310), 40, 12
'Paint (580, 50), 3, 1
t! = wind.direzione + 180
PlotLine(890, 310, 890 + (40 * c!(t!)), 310 + (40 * s!(t!)), 2)
'--End of wind's direction-------------
player(1).ship.accelerazione = Arrotonda((Pascalbar! * player(1).ship.sailarea) / 154,3)
player(2).ship.accelerazione = Arrotonda((Pascalbar! * player(2).ship.sailarea) / 154,3)
'------------- End of physics -----------------------
'------------- Drawing Arena ---------------------------
line (rx,ry)-(rw,rh),2,b
player(1).spirit.location.x = 26
player(1).spirit.location.y = 255
player(1).spirit.wid = 20
player(1).spirit.hei = 25
player(1).penalty = 0
'Barca 2
player(2).spirit.location.x = 25
player(2).spirit.location.y = 300
player(2).spirit.wid = 20
player(2).spirit.hei = 25
player(2).penalty = 0
boa(1).location.x=710
boa(1).location.y=300
boa(1).radius=9
circle (boa(1).location.x, boa(1).location.y), boa(1).radius, 7
'Drawing finish box
fshx = 14
fshy = 230
fshh = 100
fshw = 3
line (fshx, fshy) - (fshx + fshw, fshy + fshh), 14, b
SX = 0
SY = 0
S1X = 0
S1Y = 0
SX3 = 0
SY3 = 0
SX4 = 0
SY4 = 0
lastx = 0
lasty = 0
lastw = 0
lasth = 0
lastx1 = 0
lasty1 = 0
lastw1 = 0
lasth1 = 0
accrefresh = 0
PUT2(barca(),20,25,player(1).spirit.location.x,player(1).spirit.location.y )
put2(barca1(),20,25,player(2).spirit.location.x ,player(2).spirit.location.y)
trigger% = 0
'------------ Draw timoni ----------------------
player(1).ship.timone.location.x = 890
player(1).ship.timone.location.y = 150
player(1).ship.timone.angolo = wind.direzione
Circle (player(1).ship.timone.location.x, player(1).ship.timone.location.y), 30, 7
player(2).ship.timone.location.x = 890
player(2).ship.timone.location.y = 480
player(2).ship.timone.angolo = wind.direzione
Circle (player(2).ship.timone.location.x, player(2).ship.timone.location.y), 30, 7
'-------End of timone -------------------
'angle(1) = wind.direzione
angle(2) = wind.direzione
player(1).ship.andatura.bolina = true
player(1).ship.andatura.ventoadx = 1
player(2).ship.andatura.bolina = true
player(2).ship.andatura.ventoadx = 1
overlap = false
'--------------------------------------------------------------------------------
'----------------------- Start of Main ------------------------------------------
'--------------------------------------------------------------------------------
While Not trigger% = 1
Do
static as single dt
tempo = timer
Circle (player(1).ship.timone.location.x, player(1).ship.timone.location.y), 30, 7
Circle (player(2).ship.timone.location.x, player(2).ship.timone.location.y), 30, 7
'Print Using "Measured FPS : ###"; framerate()
PlotLine(890, 310, 890 + (40 * c!(t!)), 310 + (40 * s!(t!)), 1)
t! = wind.direzione + 180 +6
PlotLine(890, 310, 890 + (40 * c!(t!)), 310 + (40 * s!(t!)), 2)
if accrefresh < 2 then
else
player(1).ship.accelerazione = Arrotonda((Pascalbar! * player(1).ship.sailarea) / 154,3)
player(2).ship.accelerazione = Arrotonda((Pascalbar! * player(2).ship.sailarea) / 154,3)
accrefresh = 0
end if
delay(t0)
px = player(1).spirit.location.x
py = player(1).spirit.location.y
p2x = player(2).spirit.location.x
p2y = player(2).spirit.location.y
PUT2 Mask%(), 20, 25, px, py
PUT2 Mask%(), 20, 25, p2x, p2y
if map(player(1).spirit.location.x ,player(1).spirit.location.y)= 3 then
end if
if map(player(1).spirit.location.x ,player(1).spirit.location.y)= 0 then
player(1).ship.accelerazione -= .15
elseif map(player(1).spirit.location.x ,player(1).spirit.location.y) = 2 then
'player(1).ship.accelerazione += .015
player(1).ship.accelerazione += .15
end if
if map(player(2).spirit.location.x,player(2).spirit.location.y) = 0 then
player(2).ship.accelerazione -= .15
elseif map(player(2).spirit.location.x,player(2).spirit.location.y) = 2 then
player(2).ship.accelerazione += .15
end if
'-------------- Player one keys -----------------------------
'PgUp and PgDown to move the wheel-------------------------
If multikey(73) Then
player(1).ship.timone.angolo -=3
If player(1).ship.timone.angolo = 0 Then
player(1).ship.timone.angolo = 180
End If
SX = player(1).ship.timone.location.x + (30 * c!(player(1).ship.timone.angolo))
SY = player(1).ship.timone.location.y + (30 * s!(player(1).ship.timone.angolo))
Paint (player(1).ship.timone.location.x , player(1).ship.timone.location.y ), 1, 7
Line(player(1).ship.timone.location.x, player(1).ship.timone.location.y)-( SX, SY), 2
'player(1).ship.timone.angolo = angle(1)
End If
If multikey(81) Then
'angle(1) = angle(1) + 2
player(1).ship.timone.angolo += 3
If player(1).ship.timone.angolo > 180 Then
player(1).ship.timone.angolo = 0
End If
S1X = player(1).ship.timone.location.x + (30 * c!(player(1).ship.timone.angolo))
S1Y = player(1).ship.timone.location.y + (30 * s!(player(1).ship.timone.angolo))
Paint (player(1).ship.timone.location.x-1 , player(1).ship.timone.location.y-1 ), 1, 7
Line(player(1).ship.timone.location.x, player(1).ship.timone.location.y)-( S1X, S1Y), 2
'player(1).ship.timone.angolo = angle(1)
End If
'-----------End of wheel-----------------
if MULTIKEY(77) then
angolodibolina!(1)=radian(player(1).ship.timone.angolo)
If c!(angolodibolina!(1)) > abs(.270958) then
player(1).ship.andatura.ventoadx = 1
player(1).ship.andatura.ventoasx = 0
'player(1).ship.ventoasx = false
'player(1).ship.andatura.bolina = true
der(1) = Arrotonda(player(1).ship.accelerazione /angolodibolina!(1),2)
der(1)=der(1)*friction!
player(1).spirit.location.x = player(1).spirit.location.x + (der(1) + (-c!(337)))
player(1).spirit.location.y = player(1).spirit.location.y - (der(1) + s!(38))
else
'player(1).ship.ventoadx = true
end if
end if
if MULTIKEY(75) then
'angolodibolina!(1)=radian(53)
angolodibolina!(1)=radian(player(1).ship.timone.angolo)
If c!(angolodibolina!(1)) > abs(.270958) then
player(1).ship.andatura.ventoadx = 0
player(1).ship.andatura.ventoasx = 1
'player(1).ship.andatura.bolina = true
'andatura.bolina = true
der(1) = Arrotonda(player(1).ship.accelerazione /angolodibolina!(1),2)
der(1)=der(1)*friction!
player(1).spirit.location.x = player(1).spirit.location.x + (der(1) + (-c!(337)))
player(1).spirit.location.y = player(1).spirit.location.y + (der(1) + s!(38))
else
end if
end if
if MULTIKEY(72) then
angolodipoppa(1)= radian(player(1).ship.timone.angolo)
If c!(angolodipoppa(1)) > Abs(.9397) Then
else
player(1).ship.andatura.poppa = true
player(1).ship.andatura.ventoadx = 1
player(1).ship.andatura.ventoasx = 0
tx = sin(angolodipoppa(1))
ty = cos(angolodipoppa(1))
der(1)=Arrotonda(player(1).ship.accelerazione/angolodipoppa(1),2)*friction!
player(1).spirit.location.x=player(1).spirit.location.x-(der(1)* tx)
player(1).spirit.location.y=player(1).spirit.location.y+ty
'wind.direzione*(PI!/180)
end if
end if
if MULTIKEY(80) then
angolodipoppa(1)= radian(player(1).ship.timone.angolo)
If c!(angolodipoppa(1)) > Abs(.9397) Then
else
player(1).ship.andatura.poppa = true
player(1).ship.andatura.ventoadx = 0
player(1).ship.andatura.ventoasx = 1
'andatura.bolina = false
' andatura.angolo = wind.direzione*(PI!/180)
tx = sin(angolodipoppa(1))
ty = cos(angolodipoppa(1))
der(1)=Arrotonda(player(1).ship.accelerazione/angolodipoppa(1),2)*friction!
player(1).spirit.location.x=player(1).spirit.location.x-(der(1)*tx)
player(1).spirit.location.y=player(1).spirit.location.y-ty
'wind.direzione*(PI!/180)
end if
end if
'------------------------------------------------------------------------------
'-------------------------- End of player one keys ----------------------------
'------------------------------------------------------------------------------
'---------------------------Player 2 keys --------------------------------------
'---------------------------- Wheel --------------------------------------------
If MULTIKEY(16) Then 'kb$ = (Chr$(113)) Then
player(2).ship.timone.angolo -=3
If player(2).ship.timone.angolo = 0 Then
player(2).ship.timone.angolo = 180
End If
SX3 = player(2).ship.timone.location.x + (30 * c!(player(2).ship.timone.angolo))
SY3 = player(2).ship.timone.location.y + (30 * s!(player(2).ship.timone.angolo))
Paint (player(2).ship.timone.location.x , player(2).ship.timone.location.y ), 1, 7
Line(player(2).ship.timone.location.x, player(2).ship.timone.location.y)-( SX3, SY3), 2
End If
If MULTIKEY(44) Then 'kb$ = Chr$(122) Then
player(2).ship.timone.angolo +=3
If player(2).ship.timone.angolo = 180 Then
player(2).ship.timone.angolo = 0
End If
SX4 = player(2).ship.timone.location.x + (30 * c!(player(2).ship.timone.angolo))
SY4 = player(2).ship.timone.location.y + (30 * s!(player(2).ship.timone.angolo))
Paint (player(2).ship.timone.location.x , player(2).ship.timone.location.y ), 1, 7
Line(player(2).ship.timone.location.x, player(2).ship.timone.location.y)-( SX4, SY4), 2
End If
'----------------------- End of wheel ----------------------------------
if MULTIKEY(30) then
angolodibolina!(2)=radian(player(2).ship.timone.angolo)
If c!(angolodibolina!(2)) > abs(.270958) then
player(2).ship.andatura.ventoadx = 1
player(2).ship.andatura.ventoasx = 0
tx = cos(53)
ty = Sin(53)
'player(2).ship.andatura.bolina = true
'andatura.poppa = false
'print angolodibolina!(1)
der(2) = Arrotonda(player(2).ship.accelerazione /angolodibolina!(2),1)
der(2)=der(2)*friction!
player(2).spirit.location.x = player(2).spirit.location.x + (der(2) + (-.92))
player(2).spirit.location.y = player(2).spirit.location.y + (der(2) + .4)
else
end if
end if
If MULTIKEY(32) then 'kb$ = "d" Then
angolodibolina!(2)=radian(player(2).ship.timone.angolo)
If c!(angolodibolina!(2)) > abs(.270958) then
player(2).ship.andatura.ventoadx = 0
player(2).ship.andatura.ventoasx = 1
'player(2).ship.andatura.bolina = true
'andatura.bolina = true
'andatura.poppa = false
tx = cos(53)
ty=sin(53)
'print angolodibolina!(1)
der(2) = Arrotonda(player(2).ship.accelerazione /angolodibolina!(2),1)
der(2)=der(2)*friction!
player(2).spirit.location.x = player(2).spirit.location.x + (der(2) + (-.92))
player(2).spirit.location.y = player(2).spirit.location.y - (der(2) + .4)
else
end if
end if
If MULTIKEY(17) then 'kb$ = "w" Then
angolodipoppa(2)=radian(player(2).ship.timone.angolo)
If c!(angolodipoppa(2)) > Abs(.9397) Then
else
player(2).ship.andatura.poppa = true
player(2).ship.andatura.ventoadx = 1
player(2).ship.andatura.ventoasx = 0
tx = sin(angolodipoppa(2))
ty = cos(angolodipoppa(2))
der(2)=Arrotonda(player(2).ship.accelerazione/angolodipoppa(2),2)*friction!
player(2).spirit.location.x=player(2).spirit.location.x-(der(2)* tx)
player(2).spirit.location.y=player(2).spirit.location.y+1
end if
end if
If MULTIKEY(31) then 'kb$ = "s" Then
angolodipoppa(2)=radian(player(2).ship.timone.angolo)
If c!(angolodipoppa(2)) > Abs(.9397) Then
else
player(2).ship.andatura.poppa = true
player(2).ship.andatura.ventoadx = 0
player(2).ship.andatura.ventoasx = 1
tx = sin(angolodipoppa(2))
ty = cos(angolodipoppa(2))
der(2)=Arrotonda(player(2).ship.accelerazione/angolodipoppa(2),2)*friction!
player(2).spirit.location.x=player(2).spirit.location.x-(der(2)*tx)
player(2).spirit.location.y=player(2).spirit.location.y-1
end if
end if
'call Sprite(player(1).spirit.location.x,player(1).spirit.location.y,"BARCA01.PCX"
'------------------------- GPS ---------------------------------------------
' Who is winning?
if player(1).ship.andatura.bolina = true and player(2).ship.andatura.bolina = true then
if (player(1).spirit.location.x > player(2).spirit.location.x) then
pset (px, py - 11), 2
pset (p2x, p2y - 11), 4
else
pset (px, py - 11), 4
pset (p2x, p2y - 11), 2
end if
end if
if player(1).ship.andatura.poppa = true and player(2).ship.andatura.poppa = true then
if (player(1).spirit.location.x < player(2).spirit.location.x) then
pset (px, py - 11), 2
pset (p2x, p2y - 11), 4
else
pset (px, py - 11), 4
pset (p2x, p2y - 11), 2
end if
end if
'--------------------------------------------------------------
' Controlling "on starboard tack"
'---------------------------------------------------------------
if ((player(1).ship.andatura.ventoadx = 1 ) and (player(2).ship.andatura.ventoadx = 0 )) or (player(1).spirit.location.y > player(2).spirit.location.y) then
'if (player(1).spirit.location.y > player(2).spirit.location.y) then
circle(553,710),11,2
paint(553,710),2
circle(625,710),11,4
paint(625,710),4
else
circle(553,710),11,4
paint(553,710),4
circle(625,710),11,2
paint(625,710),2
end if
'--------------------------- Another stuff: checking overlap ------------------------------------
if abs(player(1).spirit.location.x-player(2).spirit.location.x) < 20 then
overlap = true
if (player(1).spirit.location.y > player(2).spirit.location.y) then
player(1).ship.andatura.sopravvento = true
player(2).ship.andatura.sopravvento = false
else
player(1).ship.andatura.sopravvento = false
player(2).ship.andatura.sopravvento = true
end if
else
overlap = false
end if
'--------------------- End of another stuff: checking overlap -----------------------------------
'--------------------- Wind shadow --------------------------------------------
if abs(hypot(cast(single,player(1).spirit.location.x-player(2).spirit.location.x),cast(single,player(1).spirit.location.y-player(2).spirit.location.y)) < 50) then
if player(1).ship.andatura.bolina = true and player(2).ship.andatura.bolina = true then
if (player(1).spirit.location.x > player(2).spirit.location.x) then
player(2).ship.accelerazione -= .22
'player(1).ship.accelerazione += .12
else
player(1).ship.accelerazione -= .22
'player(2).ship.accelerazione += .12
end if
end if
if player(1).ship.andatura.poppa = true and player(2).ship.andatura.poppa = true then
if (player(1).spirit.location.x < player(2).spirit.location.x) then
'player(2).ship.accelerazione += .12
player(1).ship.accelerazione -= .11
else
'player(1).ship.accelerazione += .12
player(2).ship.accelerazione -= .11
end if
end if
end if
'--------------------- End of wind shadow -------------------------------------
'------------------ Checking right boundaries ------------------------------
rbound()
'--------------------------------------------------------------------------------------------------
If ((lastx <> player(1).spirit.location.x) Or (lasty <> player(1).spirit.location.y) Or (lastw <> player(1).spirit.wid) Or (lasth <> player(1).spirit.hei)) Then
lastx = player(1).spirit.location.x
lasty = player(1).spirit.location.y
lastw = player(1).spirit.wid
lasth = player(1).spirit.hei
If (rectRect(player(1).spirit.location.x, player(1).spirit.location.y, 20, 26, rx, ry, rw, rh)) = 1 Then
counter(1) += 1
if counter(1) = 1 then
player(1).penalty = player(1).penalty + counter(1)
hit$ = "HIT"
Line (0, 0)-(799, 599), 4, B
'Line (10, 10)-(580, 450), 7, B
End If
Else
counter(1) = 0
hit$ = "NO HIT"
Line (0, 0)-(799, 599), 2, B
end if
'-------------- Checking collision with buoy ---------------------------------------------------------
If CircleRect(boa(1).location.x, boa(1).location.y, boa(1).radius, player(1).spirit.location.x, player(1).spirit.location.y, player(1).spirit.wid, player(1).spirit.hei) Then
counter(3) += 1
if counter(3) = 1 then
player(1).penalty = player(1).penalty + counter(3)
hit$ = "HIT"
Circle (boa(1).location.x, boa(1).location.y), boa(1).radius, 7
end if
Else
counter(3) = 0
hit$ = "NO HIT"
Circle (boa(1).location.x, boa(1).location.y), boa(1).radius, 5
end if
end if
If ((lastx1 <> player(2).spirit.location.x) Or (lasty1 <> player(2).spirit.location.y) Or (lastw1 <> player(2).spirit.wid) Or (lasth1 <> player(2).spirit.hei)) Then
lastx1 = player(2).spirit.location.x
lasty1 = player(2).spirit.location.y
lastw1 = player(2).spirit.wid
lasth1 = player(2).spirit.hei
If (rectRect(player(2).spirit.location.x, player(2).spirit.location.y, 20, 26, rx, ry, rw, rh)) = 1 Then
counter(2) += 1
if counter(2) = 1 then
player(2).penalty = player(2).penalty + counter(2)
hit$ = "HIT"
Line (0, 0)-(799, 599), 4, B
end if
'Line (10, 10)-(580, 450), 7, B
Else
counter(2) = 0
hit$ = "NO HIT"
Line (0, 0)-(799, 599), 2, B
End If
If CircleRect(boa(1).location.x, boa(1).location.y, boa(1).radius, player(2).spirit.location.x, player(2).spirit.location.y, player(2).spirit.wid, player(2).spirit.hei) Then
counter(4) += 1
if counter(4) = 1 then
player(2).penalty = player(2).penalty + counter(4)
hit$ = "HIT"
Circle (boa(1).location.x, boa(1).location.y), boa(1).radius, 7
end if
Else
counter(4) = 0
hit$ = "NO HIT"
Circle (boa(1).location.x, boa(1).location.y), boa(1).radius, 5
end if
end if
If rectRect2(player(1).spirit.location.x, player(1).spirit.location.y, player(1).spirit.wid, player(1).spirit.hei, fshx, fshy, fshw, fshh) = 1 Then
trigger = 1
line (fshx, fshy) - (fshx + fshw, fshy + fshh), 7, b
'Print "End of game, press Esc"
'sleep
Else
End If
If rectRect2(player(2).spirit.location.x, player(2).spirit.location.y, player(2).spirit.wid, player(2).spirit.hei, fshx, fshy, fshw, fshh) = 1 Then
trigger = 1