-
Notifications
You must be signed in to change notification settings - Fork 0
/
video.rtf
4156 lines (3808 loc) · 185 KB
/
video.rtf
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
{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600
{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;\f1\fnil\fcharset0 Menlo-Bold;}
{\colortbl;\red255\green255\blue255;\red253\green143\blue63;\red31\green31\blue36;\red252\green106\blue93;
\red255\green255\blue255;\red108\green121\blue134;\red252\green95\blue163;\red65\green161\blue192;\red208\green191\blue105;
\red103\green183\blue164;\red161\green103\blue230;\red253\green143\blue63;\red103\green183\blue164;}
{\*\expandedcolortbl;;\csgenericrgb\c99131\c56076\c24611;\csgenericrgb\c12054\c12284\c14131;\csgenericrgb\c98912\c41558\c36568;
\csgenericrgb\c100000\c100000\c100000\c85000;\csgenericrgb\c42394\c47462\c52518;\csgenericrgb\c98839\c37355\c63833;\csgenericrgb\c25490\c63137\c75294;\csgenericrgb\c81498\c74939\c41233;
\csgenericrgb\c40538\c71705\c64209;\csgenericrgb\c63137\c40392\c90196;\csgenericrgb\c99216\c56078\c24706;\csgenericrgb\c40392\c71765\c64314;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab593
\pard\tx593\pardeftab593\pardirnatural\partightenfactor0
\f0\fs24 \cf2 \cb3 #include \cf4 <math.h>\cf5 \
\cf2 #include \cf4 <stdio.h>\cf5 \
\cf2 #include \cf4 <string.h>\cf5 \
\cf2 #include \cf4 <GLUT/glut.h>\cf5 \
\cf6 //#include <irrklang/irrKlang.h>\cf5 \
\cf6 //using namespace irrklang;\cf5 \
\
\cf6 //ISoundEngine *SoundEngine = createIrrKlangDevice();\cf5 \
\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 p0\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 p1\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 p2\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 p3\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 p4\cf5 [\cf9 2\cf5 ];\
\
\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 turn\cf5 = \cf9 0\cf5 ;\
\
\cf6 //curve issues\cf5 \
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 mouseCliked\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 mouseReleased\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 inProcess\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 gameOver\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 isReached\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 isHit\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 isDefended\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 isWallHitted\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 bool
\f0\b0 \cf5 \cf8 start\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 powerValue\cf5 = \cf9 0\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 powerBar1\cf5 = \cf9 0\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 powerBar2\cf5 = \cf9 0\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 healthbar1\cf5 = \cf9 5\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 healthbar2\cf5 = \cf9 5\cf5 ;\
\
\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 player1Pos\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 player2Pos\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 endPoint\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 ballPos\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 WallHitPos\cf5 [\cf9 2\cf5 ];\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 ballIndex\cf5 = -\cf9 1\cf5 ;\
\
\
\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 windowYSize\cf5 = \cf9 900\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 windowXSize\cf5 = \cf9 1200\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 transationPLayer2X\cf5 = \cf9 4700\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 transationPLayer2Y\cf5 = \cf9 350\cf5 ;\
\f1\b \cf7 double
\f0\b0 \cf5 \cf8 xTransfer\cf5 = -\cf9 10\cf5 ;\
\f1\b \cf7 float
\f0\b0 \cf5 \cf8 translatioCLoud\cf5 = \cf9 0\cf5 ;\
\f1\b \cf7 float
\f0\b0 \cf5 \cf8 scaling\cf5 = \cf9 0.2\cf5 ;\
\f1\b \cf7 float
\f0\b0 \cf5 \cf8 colorStatusColor\cf5 = \cf9 0\cf5 ;\
\f1\b \cf7 float
\f0\b0 \cf5 \cf8 wallHitTime\cf5 =\cf9 0\cf5 ;\
\f1\b \cf7 float
\f0\b0 \cf5 \cf8 translateMoon\cf5 =\cf9 0\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 translateMoon1\cf5 =\cf9 0\cf5 ;\
\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 d\cf5 =\cf9 0\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 \cf8 xDaynamic\cf5 =\cf9 0\cf5 ;\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 drawCircle\cf5 (
\f1\b \cf7 double
\f0\b0 \cf5 radius,
\f1\b \cf7 float
\f0\b0 \cf5 x1,
\f1\b \cf7 float
\f0\b0 \cf5 y1) \{\
\f1\b \cf7 float
\f0\b0 \cf5 x2, y2;\
\f1\b \cf7 float
\f0\b0 \cf5 angle;\
y1 = \cf10 windowYSize\cf5 - y1;\
\
\cf11 glBegin\cf5 (\cf12 GL_TRIANGLE_FAN\cf5 );\
\cf11 glVertex2f\cf5 (x1, y1);\
\
\f1\b \cf7 for
\f0\b0 \cf5 (angle = \cf9 1.0f\cf5 ; angle < \cf9 361.0f\cf5 ; angle += \cf9 0.2\cf5 )\
\{\
x2 = x1 + \cf11 sin\cf5 (angle) * radius;\
y2 = y1 + \cf11 cos\cf5 (angle) * radius;\
\cf11 glVertex2f\cf5 (x2, y2);\
\}\
\
\cf11 glEnd\cf5 ();\
\}\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 drawCircleHole\cf5 (
\f1\b \cf7 float
\f0\b0 \cf5 r,
\f1\b \cf7 float
\f0\b0 \cf5 cx,
\f1\b \cf7 float
\f0\b0 \cf5 cy)\{\
\f1\b \cf7 int
\f0\b0 \cf5 num_segments=\cf9 100\cf5 ;\
\cf11 glBegin\cf5 (\cf12 GL_LINE_LOOP\cf5 );\
\f1\b \cf7 for
\f0\b0 \cf5 (
\f1\b \cf7 int
\f0\b0 \cf5 ii = \cf9 0\cf5 ; ii < num_segments; ii++)\
\{\
\f1\b \cf7 float
\f0\b0 \cf5 theta = \cf9 2.0f\cf5 * \cf9 3.1415926f\cf5 *
\f1\b \cf7 float
\f0\b0 \cf5 (ii) /
\f1\b \cf7 float
\f0\b0 \cf5 (num_segments);\cf6 //get the current angle\cf5 \
\
\f1\b \cf7 float
\f0\b0 \cf5 x = r * \cf11 cosf\cf5 (theta);\cf6 //calculate the x component\cf5 \
\f1\b \cf7 float
\f0\b0 \cf5 y = r * \cf11 sinf\cf5 (theta);\cf6 //calculate the y component\cf5 \
\
\cf11 glVertex2f\cf5 (x + cx, y + cy);\cf6 //output vertex\cf5 \
\
\}\
\cf11 glEnd\cf5 ();\
\}\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 drawCircle1\cf5 (
\f1\b \cf7 double
\f0\b0 \cf5 radius,
\f1\b \cf7 float
\f0\b0 \cf5 x1,
\f1\b \cf7 float
\f0\b0 \cf5 y1) \{\
\f1\b \cf7 float
\f0\b0 \cf5 x2, y2;\
\f1\b \cf7 float
\f0\b0 \cf5 angle;\
y1 = y1;\
\
\cf11 glBegin\cf5 (\cf12 GL_TRIANGLE_FAN\cf5 );\
\cf11 glVertex2f\cf5 (x1, y1);\
\
\f1\b \cf7 for
\f0\b0 \cf5 (angle = \cf9 1.0f\cf5 ; angle < \cf9 361.0f\cf5 ; angle += \cf9 0.2\cf5 )\
\{\
x2 = x1 + \cf11 sin\cf5 (angle) * radius;\
y2 = y1 + \cf11 cos\cf5 (angle) * radius;\
\cf11 glVertex2f\cf5 (x2, y2);\
\}\
\
\cf11 glEnd\cf5 ();\
\}\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 convertor\cf5 () \{\
\f1\b \cf7 int
\f0\b0 \cf5 shiftYUP = \cf9 50\cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (\cf10 turn\cf5 % \cf9 2\cf5 == \cf9 0\cf5 ) \{\
\
\cf10 p3\cf5 [\cf9 0\cf5 ] = \cf10 player2Pos\cf5 [\cf9 0\cf5 ];\
\cf10 p3\cf5 [\cf9 1\cf5 ] = \cf10 player2Pos\cf5 [\cf9 1\cf5 ];\
\
\cf10 p0\cf5 [\cf9 0\cf5 ] = \cf10 p3\cf5 [\cf9 0\cf5 ] - \cf10 powerValue\cf5 ;\
\cf10 p0\cf5 [\cf9 1\cf5 ] = shiftYUP;\
\
\cf10 p1\cf5 [\cf9 0\cf5 ] = \cf10 p0\cf5 [\cf9 0\cf5 ];\
\cf10 p1\cf5 [\cf9 1\cf5 ] = shiftYUP + \cf9 0.5\cf5 * (\cf10 p3\cf5 [\cf9 0\cf5 ] - \cf10 p0\cf5 [\cf9 0\cf5 ]);\
\
\f1\b \cf7 if
\f0\b0 \cf5 (\cf9 0.75\cf5 * (\cf10 p3\cf5 [\cf9 0\cf5 ] - \cf10 p0\cf5 [\cf9 0\cf5 ]) <= \cf9 50\cf5 ) shiftYUP = \cf9 100\cf5 ;\
\cf10 p2\cf5 [\cf9 0\cf5 ] = \cf10 p3\cf5 [\cf9 0\cf5 ] - (\cf9 4\cf5 + \cf9 8\cf5 * ((\cf10 powerValue\cf5 ) / \cf9 63\cf5 ));\
\cf10 p2\cf5 [\cf9 1\cf5 ] = shiftYUP + \cf9 0.75\cf5 * (\cf10 p3\cf5 [\cf9 0\cf5 ] - \cf10 p0\cf5 [\cf9 0\cf5 ]);\
\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\
\
\cf10 p0\cf5 [\cf9 0\cf5 ] = \cf10 player1Pos\cf5 [\cf9 0\cf5 ];\
\cf10 p0\cf5 [\cf9 1\cf5 ] = \cf10 player1Pos\cf5 [\cf9 1\cf5 ];\
\
\cf10 p3\cf5 [\cf9 0\cf5 ] = \cf10 p0\cf5 [\cf9 0\cf5 ] + \cf10 powerValue\cf5 ;\
\cf10 p3\cf5 [\cf9 1\cf5 ] = shiftYUP;\
\
\cf10 p2\cf5 [\cf9 0\cf5 ] = \cf10 p3\cf5 [\cf9 0\cf5 ];\
\cf10 p2\cf5 [\cf9 1\cf5 ] = shiftYUP + \cf9 0.5\cf5 * (\cf10 p3\cf5 [\cf9 0\cf5 ] - \cf10 p0\cf5 [\cf9 0\cf5 ]);\
\
\f1\b \cf7 if
\f0\b0 \cf5 (\cf9 0.75\cf5 * (\cf10 p3\cf5 [\cf9 0\cf5 ] - \cf10 p0\cf5 [\cf9 0\cf5 ]) <= \cf9 50\cf5 ) shiftYUP = \cf9 100\cf5 ;\
\cf10 p1\cf5 [\cf9 0\cf5 ] = \cf10 p0\cf5 [\cf9 0\cf5 ] + (\cf9 4\cf5 + \cf9 8\cf5 * ((\cf10 powerValue\cf5 ) / \cf9 63\cf5 ));\
\cf10 p1\cf5 [\cf9 1\cf5 ] = shiftYUP + \cf9 0.75\cf5 * (\cf10 p3\cf5 [\cf9 0\cf5 ] - \cf10 p0\cf5 [\cf9 0\cf5 ]);\
\}\
\}\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 powerUP\cf5 () \{\
\f1\b \cf7 if
\f0\b0 \cf5 (\cf10 turn\cf5 % \cf9 2\cf5 == \cf9 0\cf5 ) \cf10 powerBar1\cf5 += \cf9 3\cf5 ;\
\f1\b \cf7 else
\f0\b0 \cf5 \cf10 powerBar2\cf5 += \cf9 3\cf5 ;\
\}\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 mouseListener\cf5 (
\f1\b \cf7 int
\f0\b0 \cf5 button,
\f1\b \cf7 int
\f0\b0 \cf5 state,
\f1\b \cf7 int
\f0\b0 \cf5 x,
\f1\b \cf7 int
\f0\b0 \cf5 y)\
\{\
\f1\b \cf7 if
\f0\b0 \cf5 (button == \cf12 GLUT_LEFT_BUTTON\cf5 && state == \cf12 GLUT_DOWN\cf5 )\
\{\
\f1\b \cf7 if
\f0\b0 \cf5 (!\cf10 inProcess\cf5 )\
\{\
\cf13 powerUP\cf5 ();\
\cf10 mouseCliked\cf5 =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
\}\
\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \
\{\
\f1\b \cf7 if
\f0\b0 \cf5 (button == \cf12 GLUT_LEFT_BUTTON\cf5 && state == \cf12 GLUT_UP\cf5 )\
\{\
\f1\b \cf7 if
\f0\b0 \cf5 (\cf10 mouseCliked\cf5 )\
\{\
\cf10 mouseReleased\cf5 =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
\cf10 mouseCliked\cf5 =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (\cf10 turn\cf5 % \cf9 2\cf5 == \cf9 0\cf5 )\
\{\
\cf10 powerValue\cf5 = \cf10 powerBar1\cf5 ;\
\
\cf10 powerBar1\cf5 = \cf9 0\cf5 ;\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \
\{\
\cf10 powerValue\cf5 = \cf10 powerBar2\cf5 ;\
\cf10 powerBar2\cf5 = \cf9 0\cf5 ;\
\}\
\
\cf10 turn\cf5 ++;\
\cf13 convertor\cf5 ();\
\cf10 inProcess\cf5 =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
\
\}\
\}\
\
\}\
\
\cf11 glutPostRedisplay\cf5 ();\
\}\
\f1\b \cf7 int
\f0\b0 \cf5 * \cf8 bezier\cf5 (
\f1\b \cf7 float
\f0\b0 \cf5 t,
\f1\b \cf7 int
\f0\b0 \cf5 * p0,
\f1\b \cf7 int
\f0\b0 \cf5 * p1,
\f1\b \cf7 int
\f0\b0 \cf5 * p2,
\f1\b \cf7 int
\f0\b0 \cf5 * p3)\
\{\
\f1\b \cf7 int
\f0\b0 \cf5 res[\cf9 2\cf5 ];\
res[\cf9 0\cf5 ] = \cf11 pow\cf5 ((\cf9 1\cf5 - t), \cf9 3\cf5 ) * p0[\cf9 0\cf5 ] + \cf9 3\cf5 * t * \cf11 pow\cf5 ((\cf9 1\cf5 - t), \cf9 2\cf5 ) * p1[\cf9 0\cf5 ] + \cf9 3\cf5 * \cf11 pow\cf5 (t, \cf9 2\cf5 ) * (\cf9 1\cf5 - t) * p2[\cf9 0\cf5 ] + \cf11 pow\cf5 (t, \cf9 3\cf5 ) * p3[\cf9 0\cf5 ];\
res[\cf9 1\cf5 ] = \cf11 pow\cf5 ((\cf9 1\cf5 - t), \cf9 3\cf5 ) * p0[\cf9 1\cf5 ] + \cf9 3\cf5 * t * \cf11 pow\cf5 ((\cf9 1\cf5 - t), \cf9 2\cf5 ) * p1[\cf9 1\cf5 ] + \cf9 3\cf5 * \cf11 pow\cf5 (t, \cf9 2\cf5 ) * (\cf9 1\cf5 - t) * p2[\cf9 1\cf5 ] + \cf11 pow\cf5 (t, \cf9 3\cf5 ) * p3[\cf9 1\cf5 ];\
\f1\b \cf7 return
\f0\b0 \cf5 res;\
\}\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 Anim\cf5 ()\
\{\
\
\f1\b \cf7 if
\f0\b0 \cf5 (start)\{\
translateMoon+=\cf9 .3\cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (translateMoon<\cf9 1\cf5 && translateMoon>-\cf9 1\cf5 )\
start=
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (translateMoon>\cf9 900\cf5 )\
translateMoon=-\cf9 300\cf5 ;\
\
\
\}
\f1\b \cf7 else
\f0\b0 \cf5 \{\
translateMoon1++;\
\f1\b \cf7 if
\f0\b0 \cf5 (translateMoon1==\cf9 200\cf5 )\{\
start=
\f1\b \cf7 true
\f0\b0 \cf5 ;\
translateMoon1=\cf9 0\cf5 ;\
\}\
\}\
\f1\b \cf7 if
\f0\b0 \cf5 (!gameOver) \{\
\
xDaynamic++;\
\f1\b \cf7 if
\f0\b0 \cf5 (xDaynamic%\cf9 30\cf5 ==\cf9 0\cf5 )\
d++;\
\f1\b \cf7 if
\f0\b0 \cf5 (inProcess)\
\{\
\f1\b \cf7 int
\f0\b0 \cf5 XWallMin=\cf9 565\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 XWallMax=\cf9 600\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 YWallMin=\cf9 0\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 YWallMax=\cf9 420\cf5 ;\
\f1\b \cf7 float
\f0\b0 \cf5 Xmin = translatioCLoud;\
\f1\b \cf7 float
\f0\b0 \cf5 Xmax = \cf9 220\cf5 + translatioCLoud;\
\f1\b \cf7 float
\f0\b0 \cf5 Ymin = \cf9 450\cf5 ;\
\f1\b \cf7 float
\f0\b0 \cf5 Ymax = \cf9 590\cf5 ;\
printf(\cf4 "p0=\{%d ,%d\} p1=\{%d ,%d\} p2=\{%d ,%d\} p3=\{%d ,%d\} ,ballIndex=%d \\n"\cf5 , p0[\cf9 0\cf5 ], p0[\cf9 1\cf5 ], p1[\cf9 0\cf5 ], p1[\cf9 1\cf5 ], p2[\cf9 0\cf5 ], p2[\cf9 1\cf5 ], p3[\cf9 0\cf5 ], p3[\cf9 1\cf5 ], ballIndex);\
\f1\b \cf7 if
\f0\b0 \cf5 (ballIndex == -\cf9 1\cf5 ) ballIndex = \cf9 0\cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (ballIndex < \cf9 200\cf5 )\
\{\
\f1\b \cf7 if
\f0\b0 \cf5 (turn % \cf9 2\cf5 == \cf9 1\cf5 ) \{\
\f1\b \cf7 float
\f0\b0 \cf5 t = ((
\f1\b \cf7 float
\f0\b0 \cf5 )ballIndex) / \cf9 200\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 * p = bezier(t, p0, p1, p2, p3);\
ballPos[\cf9 0\cf5 ] = p[\cf9 0\cf5 ];\
ballPos[\cf9 1\cf5 ] = p[\cf9 1\cf5 ];\
\
\f1\b \cf7 if
\f0\b0 \cf5 (!isHit && ballPos[\cf9 0\cf5 ] >= \cf9 960\cf5 && ballPos[\cf9 0\cf5 ] <= \cf9 1070\cf5 && ballPos[\cf9 1\cf5 ] >= \cf9 50\cf5 && ballPos[\cf9 1\cf5 ] <= \cf9 200\cf5 ) \{\
isHit =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
healthbar2--;\
\}\
\f1\b \cf7 if
\f0\b0 \cf5 (healthbar2 == \cf9 0\cf5 ) gameOver =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\f1\b \cf7 float
\f0\b0 \cf5 t = \cf9 1\cf5 - ((
\f1\b \cf7 float
\f0\b0 \cf5 )ballIndex) / \cf9 150\cf5 ;\
\f1\b \cf7 int
\f0\b0 \cf5 * p = bezier(t, p0, p1, p2, p3);\
ballPos[\cf9 0\cf5 ] = p[\cf9 0\cf5 ];\
ballPos[\cf9 1\cf5 ] = p[\cf9 1\cf5 ];\
\
\f1\b \cf7 if
\f0\b0 \cf5 (!isHit && ballPos[\cf9 0\cf5 ] >= \cf9 70\cf5 && ballPos[\cf9 0\cf5 ] <= \cf9 180\cf5 && ballPos[\cf9 1\cf5 ] >= \cf9 50\cf5 && ballPos[\cf9 1\cf5 ] <= \cf9 200\cf5 ) \{\
isHit =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
healthbar1--;\
\}\
\f1\b \cf7 if
\f0\b0 \cf5 (healthbar1 == \cf9 0\cf5 ) gameOver=
\f1\b \cf7 true
\f0\b0 \cf5 ;\
\}\
\
\f1\b \cf7 if
\f0\b0 \cf5 (ballPos[\cf9 0\cf5 ] >= Xmin && ballPos[\cf9 0\cf5 ] <= Xmax && ballPos[\cf9 1\cf5 ] >= Ymin && ballPos[\cf9 1\cf5 ] <= Ymax) \{\
isDefended =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
ballIndex = \cf9 400\cf5 ;\
ballPos[\cf9 0\cf5 ]=-\cf9 1000\cf5 ;\
ballPos[\cf9 1\cf5 ]=-\cf9 1000\cf5 ;\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\f1\b \cf7 if
\f0\b0 \cf5 (ballPos[\cf9 0\cf5 ] >= XWallMin && ballPos[\cf9 0\cf5 ] <= XWallMax && ballPos[\cf9 1\cf5 ] >= YWallMin && ballPos[\cf9 1\cf5 ] <= YWallMax) \{\
isWallHitted =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
ballIndex = \cf9 400\cf5 ;\
WallHitPos[\cf9 0\cf5 ]=ballPos[\cf9 0\cf5 ];\
WallHitPos[\cf9 1\cf5 ]=ballPos[\cf9 1\cf5 ];\
ballPos[\cf9 0\cf5 ]=-\cf9 1000\cf5 ;\
ballPos[\cf9 1\cf5 ]=-\cf9 1000\cf5 ;\
\}\
\}\
ballIndex++;\
\f1\b \cf7 if
\f0\b0 \cf5 (ballIndex == \cf9 150\cf5 ) \{\
ballPos[\cf9 0\cf5 ]=-\cf9 1000\cf5 ;\
ballPos[\cf9 1\cf5 ]=-\cf9 1000\cf5 ;\
inProcess =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
ballIndex = -\cf9 1\cf5 ;\
isHit =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\
\}\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
ballIndex = -\cf9 1\cf5 ;\
inProcess =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
isHit =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\
\}\
\}\
\f1\b \cf7 if
\f0\b0 \cf5 (mouseCliked) powerUP();\
\
translatioCLoud += \cf9 0.5\cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (translatioCLoud > \cf9 1300\cf5 ) translatioCLoud = -\cf9 300\cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (xTransfer > \cf9 10\cf5 ) isReached =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (xTransfer < -\cf9 10\cf5 ) isReached =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\
\f1\b \cf7 if
\f0\b0 \cf5 (!isReached) xTransfer += \cf9 .0001\cf5 ;\
\f1\b \cf7 else
\f0\b0 \cf5 xTransfer -= \cf9 .0001\cf5 ;\
\
\
\f1\b \cf7 if
\f0\b0 \cf5 (xTransfer > \cf9 10\cf5 ) isReached =
\f1\b \cf7 true
\f0\b0 \cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (xTransfer < -\cf9 10\cf5 ) isReached =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\
\f1\b \cf7 if
\f0\b0 \cf5 (!isReached) xTransfer += \cf9 .5\cf5 ;\
\f1\b \cf7 else
\f0\b0 \cf5 xTransfer -= \cf9 .5\cf5 ;\
\cf6 //change\cf5 \
colorStatusColor += \cf9 0.004\cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (colorStatusColor >= \cf9 1\cf5 ) \{\
colorStatusColor = \cf9 0\cf5 ;\
isDefended =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\}\
\cf6 //change\cf5 \
\f1\b \cf7 if
\f0\b0 \cf5 (isWallHitted)\
wallHitTime += \cf9 0.08\cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (wallHitTime >= \cf9 1\cf5 ) \{\
printf(\cf4 "Here=\{%d ,%d\}"\cf5 ,WallHitPos[\cf9 0\cf5 ],WallHitPos[\cf9 1\cf5 ]);\
wallHitTime = \cf9 0\cf5 ;\
isWallHitted =
\f1\b \cf7 false
\f0\b0 \cf5 ;\
\}\
\}\
glutPostRedisplay();\
\}\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 drawPowerBar\cf5 (
\f1\b \cf7 bool
\f0\b0 \cf5 direction) \{\
\
\cf11 glPushMatrix\cf5 ();\
glScalef(\cf9 .9\cf5 , \cf9 .8\cf5 , \cf9 1\cf5 );\
glTranslatef(\cf9 1150\cf5 , -\cf9 480\cf5 , \cf9 0\cf5 );\
\
\f1\b \cf7 if
\f0\b0 \cf5 (direction) \{\
glTranslatef(-\cf9 130\cf5 , \cf9 0\cf5 , \cf9 0\cf5 );\
\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
glTranslatef(-\cf9 900\cf5 , \cf9 0\cf5 , \cf9 0\cf5 );\
glScalef(-\cf9 1\cf5 , \cf9 1\cf5 , \cf9 1\cf5 );\
\}\
\
\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar2 > \cf9 0\cf5 && direction) \{\
glColor3f(\cf9 1\cf5 , \cf9 0.933\cf5 , \cf9 0.549\cf5 );\
glBegin(GL_TRIANGLES);\
glVertex3f(\cf9 125.43\cf5 , windowYSize - \cf9 59.65\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 204.27\cf5 , windowYSize - \cf9 96.82\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 112.59\cf5 , windowYSize - \cf9 19.41\cf5 , \cf9 0\cf5 );\
glEnd();\
\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar1 > \cf9 0\cf5 && !direction) \{\
glColor3f(\cf9 0.58\cf5 , \cf9 0\cf5 , \cf9 0.062\cf5 );\
glBegin(GL_TRIANGLES);\
glVertex3f(\cf9 125.43\cf5 , windowYSize - \cf9 59.65\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 204.27\cf5 , windowYSize - \cf9 96.82\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 112.59\cf5 , windowYSize - \cf9 19.41\cf5 , \cf9 0\cf5 );\
glEnd();\
\}\
\}\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar2 > \cf9 300\cf5 && direction) \{\
glColor3f(\cf9 1\cf5 , \cf9 0.933\cf5 , \cf9 0.549\cf5 );\
glBegin(GL_POLYGON);\
glVertex3f(\cf9 125.43\cf5 , windowYSize - \cf9 59.65\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 112.59\cf5 , windowYSize - \cf9 19.41\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 99.57\cf5 , windowYSize - \cf9 48.64\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 109.75\cf5 , windowYSize - \cf9 95.52\cf5 , \cf9 0\cf5 );\
glEnd();\
\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar1 > \cf9 300\cf5 && !direction) \{\
glColor3f(\cf9 0.58\cf5 , \cf9 0\cf5 , \cf9 0.062\cf5 );\
glBegin(GL_POLYGON);\
glVertex3f(\cf9 125.43\cf5 , windowYSize - \cf9 59.65\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 112.59\cf5 , windowYSize - \cf9 19.41\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 99.57\cf5 , windowYSize - \cf9 48.64\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 109.75\cf5 , windowYSize - \cf9 95.52\cf5 , \cf9 0\cf5 );\
glEnd();\
\}\
\}\
\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar2 > \cf9 500\cf5 && direction) \{\
glColor3f(\cf9 1\cf5 , \cf9 0.933\cf5 , \cf9 0.549\cf5 );\
glBegin(GL_POLYGON);\
glVertex3f(\cf9 99.57\cf5 , windowYSize - \cf9 48.64\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 109.75\cf5 , windowYSize - \cf9 95.52\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 81.38\cf5 , windowYSize - \cf9 61.65\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 67.61\cf5 , windowYSize - \cf9 21.27\cf5 , \cf9 0\cf5 );\
glEnd();\
\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar1 > \cf9 500\cf5 && !direction) \{\
glBegin(GL_POLYGON);\
glColor3f(\cf9 0.58\cf5 , \cf9 0\cf5 , \cf9 0.062\cf5 );\
glVertex3f(\cf9 99.57\cf5 , windowYSize - \cf9 48.64\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 109.75\cf5 , windowYSize - \cf9 95.52\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 81.38\cf5 , windowYSize - \cf9 61.65\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 67.61\cf5 , windowYSize - \cf9 21.27\cf5 , \cf9 0\cf5 );\
glEnd();\
\}\
\}\
\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar2 > \cf9 700\cf5 && direction) \{\
glColor3f(\cf9 1\cf5 , \cf9 0.933\cf5 , \cf9 0.549\cf5 );\
glBegin(GL_POLYGON);\
glVertex3f(\cf9 81.38\cf5 , windowYSize - \cf9 61.65\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 67.61\cf5 , windowYSize - \cf9 21.27\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 55.98\cf5 , windowYSize - \cf9 51.64\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 70.66\cf5 , windowYSize - \cf9 96.82\cf5 , \cf9 0\cf5 );\
glEnd();\
\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar1 > \cf9 700\cf5 && !direction) \{\
glColor3f(\cf9 0.58\cf5 , \cf9 0\cf5 , \cf9 0.062\cf5 );\
glBegin(GL_POLYGON);\
glVertex3f(\cf9 81.38\cf5 , windowYSize - \cf9 61.65\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 67.61\cf5 , windowYSize - \cf9 21.27\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 55.98\cf5 , windowYSize - \cf9 51.64\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 70.66\cf5 , windowYSize - \cf9 96.82\cf5 , \cf9 0\cf5 );\
glEnd();\
\}\
\}\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar2 > \cf9 950\cf5 && direction) \{\
glColor3f(\cf9 1\cf5 , \cf9 0.933\cf5 , \cf9 0.549\cf5 );\
glBegin(GL_TRIANGLES);\
glVertex3f(\cf9 5.05\cf5 , windowYSize - \cf9 12\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 70.66\cf5 , windowYSize - \cf9 96.82\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 55.98\cf5 , windowYSize - \cf9 51.64\cf5 , \cf9 0\cf5 );\
glEnd();\
\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\f1\b \cf7 if
\f0\b0 \cf5 (powerBar1 > \cf9 950\cf5 && !direction) \{\
glColor3f(\cf9 0.58\cf5 , \cf9 0\cf5 , \cf9 0.062\cf5 );\
glBegin(GL_TRIANGLES);\
glVertex3f(\cf9 5.05\cf5 , windowYSize - \cf9 12\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 70.66\cf5 , windowYSize - \cf9 96.82\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 55.98\cf5 , windowYSize - \cf9 51.64\cf5 , \cf9 0\cf5 );\
glEnd();\
\}\
\}\
glColor3f(\cf9 0\cf5 , \cf9 0\cf5 , \cf9 0\cf5 );\
glBegin(GL_LINE_LOOP);\
\
glVertex3f(\cf9 5.05\cf5 , windowYSize - \cf9 12\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 70.66\cf5 , windowYSize - \cf9 96.82\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 81.38\cf5 , windowYSize - \cf9 61.65\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 109.75\cf5 , windowYSize - \cf9 95.52\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 125.43\cf5 , windowYSize - \cf9 59.65\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 204.27\cf5 , windowYSize - \cf9 96.82\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 112.59\cf5 , windowYSize - \cf9 19.41\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 99.57\cf5 , windowYSize - \cf9 48.64\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 67.61\cf5 , windowYSize - \cf9 21.27\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 55.98\cf5 , windowYSize - \cf9 51.64\cf5 , \cf9 0\cf5 );\
glEnd();\
\
glPopMatrix();\
\
\cf6 //\cf5 \
\
\}\
\f1\b \cf7 void
\f0\b0 \cf5 \cf8 drawCloud\cf5 (
\f1\b \cf7 bool
\f0\b0 \cf5 status ,
\f1\b \cf7 bool
\f0\b0 \cf5 s2) \{\
\f1\b \cf7 if
\f0\b0 \cf5 (status)\{\
\f1\b \cf7 float
\f0\b0 \cf5 cloudColor = \cf9 1\cf5 ;\
\f1\b \cf7 if
\f0\b0 \cf5 (isDefended&& turn%\cf9 2\cf5 ==\cf9 0\cf5 )\{\
\
\f1\b \cf7 float
\f0\b0 \cf5 rg=\cf9 1\cf5 -(\cf9 0.342\cf5 )*colorStatusColor;\
\f1\b \cf7 float
\f0\b0 \cf5 b=\cf9 1\cf5 -(\cf9 0.33\cf5 )*colorStatusColor;\
glColor3f(rg , rg, b);\
\cf6 //printf("%1.2f %1.4f", rg , b);\cf5 \
\}\
\f1\b \cf7 else
\f0\b0 \cf5 \{\
\f1\b \cf7 if
\f0\b0 \cf5 (isDefended && turn % \cf9 2\cf5 == \cf9 1\cf5 )\{\
\
\f1\b \cf7 float
\f0\b0 \cf5 r=\cf9 1\cf5 -(\cf9 0.851\cf5 )*colorStatusColor;\
\f1\b \cf7 float
\f0\b0 \cf5 g=\cf9 1\cf5 -(\cf9 0.325\cf5 )*colorStatusColor;\
printf(\cf4 "color =%1.4f %1.4f %1.4f \\n "\cf5 , r , g, colorStatusColor);\
glColor3f(r, g, \cf9 1\cf5 );\
\}\
\f1\b \cf7 else
\f0\b0 \cf5 glColor3f(cloudColor, cloudColor, cloudColor);\
\
\}\
\cf6 //glLineWidth(15);\cf5 \
glPushMatrix();\
\
glTranslatef(translatioCLoud, -\cf9 300\cf5 , \cf9 0\cf5 );\
glBegin(GL_POLYGON);\
\
glVertex3f(\cf9 35.79\cf5 , windowYSize - \cf9 58.27\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 42.21\cf5 , windowYSize - \cf9 45.52\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 49.1\cf5 , windowYSize - \cf9 39.81\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 57.02\cf5 , windowYSize - \cf9 36.47\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 68.37\cf5 , windowYSize - \cf9 36.47\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 77.89\cf5 , windowYSize - \cf9 39.81\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 79.84\cf5 , windowYSize - \cf9 31.2\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 83.51\cf5 , windowYSize - \cf9 26.61\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 95.44\cf5 , windowYSize - \cf9 17.36\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 105.43\cf5 , windowYSize - \cf9 12.94\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 119.79\cf5 , windowYSize - \cf9 9.6\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 140.07\cf5 , windowYSize - \cf9 10.27\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 150.14\cf5 , windowYSize - \cf9 12.94\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 159.69\cf5 , windowYSize - \cf9 17.36\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 175.13\cf5 , windowYSize - \cf9 29.21\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 180.49\cf5 , windowYSize - \cf9 36.98\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 186.4\cf5 , windowYSize - \cf9 45.52\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 188.06\cf5 , windowYSize - \cf9 60.66\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 203.92\cf5 , windowYSize - \cf9 67.61\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 217.78\cf5 , windowYSize - \cf9 83.21\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 220.62\cf5 , windowYSize - \cf9 99.07\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 217.46\cf5 , windowYSize - \cf9 111.05\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 214.94\cf5 , windowYSize - \cf9 120.61\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 207.45\cf5 , windowYSize - \cf9 129.59\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 195.99\cf5 , windowYSize - \cf9 134.54\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 177.63\cf5 , windowYSize - \cf9 134.54\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 169.92\cf5 , windowYSize - \cf9 142.62\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 158.69\cf5 , windowYSize - \cf9 146.4\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 146.8\cf5 , windowYSize - \cf9 147.53\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 132.98\cf5 , windowYSize - \cf9 143.06\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 126.21\cf5 , windowYSize - \cf9 149.73\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 119.79\cf5 , windowYSize - \cf9 153.24\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 105.43\cf5 , windowYSize - \cf9 156.46\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 89.93\cf5 , windowYSize - \cf9 156.46\cf5 , \cf9 0\cf5 );\
\
\
glVertex3f(\cf9 77.89\cf5 , windowYSize - \cf9 153.24\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 63.89\cf5 , windowYSize - \cf9 147.32\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 53.69\cf5 , windowYSize - \cf9 139.55\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 44.5\cf5 , windowYSize - \cf9 132.04\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 31.5\cf5 , windowYSize - \cf9 135.04\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 20.3\cf5 , windowYSize - \cf9 132.04\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 6.53\cf5 , windowYSize - \cf9 120.61\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 2.77\cf5 , windowYSize - \cf9 111.96\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 2.77\cf5 , windowYSize - \cf9 103.66\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 2.77\cf5 , windowYSize - \cf9 91.31\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 6.53\cf5 , windowYSize - \cf9 83.21\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 20.3\cf5 , windowYSize - \cf9 71.53\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 26.98\cf5 , windowYSize - \cf9 69.44\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 33.49\cf5 , windowYSize - \cf9 69.44\cf5 , \cf9 0\cf5 );\
glEnd();\
\f1\b \cf7 if
\f0\b0 \cf5 (isDefended)\{\
\f1\b \cf7 float
\f0\b0 \cf5 gray=\cf9 1\cf5 -colorStatusColor;\
glColor3f(gray,gray, gray);\
\}
\f1\b \cf7 else
\f0\b0 \cf5 \
glColor3f(cloudColor, cloudColor, cloudColor);\
\
\
glBegin(GL_LINE_LOOP);\
\
glVertex3f(\cf9 35.79\cf5 , windowYSize - \cf9 58.27\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 42.21\cf5 , windowYSize - \cf9 45.52\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 49.1\cf5 , windowYSize - \cf9 39.81\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 57.02\cf5 , windowYSize - \cf9 36.47\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 68.37\cf5 , windowYSize - \cf9 36.47\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 77.89\cf5 , windowYSize - \cf9 39.81\cf5 , \cf9 0\cf5 );\
\
glVertex3f(\cf9 79.84\cf5 , windowYSize - \cf9 31.2\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 83.51\cf5 , windowYSize - \cf9 26.61\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 95.44\cf5 , windowYSize - \cf9 17.36\cf5 , \cf9 0\cf5 );\
glVertex3f(\cf9 105.43\cf5 , windowYSize - \cf9 12.94\cf5 , \cf9 0\cf5 );\