TX Library Help – Version: 00173a, Revision: 173
 ALL  Windows graphics in a sandbox

MinecraftStory.cpp

См. документацию.
00001 //{===========================================================================
00010 //          (C) Васильев Валерий, 7 класс, 2013
00011 //}===========================================================================
00012 
00013 #include "TXLib.h"
00014 
00015 // Прототипы
00016 
00017 void MainDraw (COLORREF color);
00018 void Grass (COLORREF color, int Up);
00019 void Ground (COLORREF color);
00020 void Tree (COLORREF color, int Up, COLORREF Trunk, int UpLeaf, int Width1, int Width2, int Up1, int Up2, int Apples, int R);
00021 void House (int Open, int Crack, int Pipe, COLORREF ColorSmoke, int Fire, int Height, int Length);
00022 void Sun (int x, int y, COLORREF color, double Size, double Length);
00023 void Cloud (int x, int y, COLORREF color, COLORREF colorbg, double Size, int Height, int Length, int Length2);
00024 void Creeper (int x, int y, double Size, COLORREF color, int Eye, COLORREF EyeColor, int Neck, COLORREF Foot);
00025 void Man (int x, int y, double Size, int Turn, COLORREF pants, COLORREF shirt, COLORREF Hair, double PantsUp);
00026 void Boom (int x, int y, COLORREF color, double Size, double Length);
00027 void Scenery();
00028 void Scenery2();
00029 void Scenery3();
00030 void Scenery4();
00031 void RunToTree();
00032 void RunFromTree();
00033 void CreeperAppears();
00034 void ManTurn();
00035 void RunFromCreeper();
00036 void Rise1();
00037 void Rise2();
00038 void CreeperDraw();
00039 void CreeperRun();
00040 void CreeperJump();
00041 void Boom();
00042 void AddCrack();
00043 void Wait();
00044 void DoorOpen();
00045 void ManDraw();
00046 void Descent1();
00047 void Descent2();
00048 void RunToTreeNight();
00049 void CreepersAdd();
00050 void ManTurn2();
00051 void CreepersAdd2();
00052 void ManTurn3();
00053 void Booms();
00054 void Clear();
00055 void FinishTitles();
00056 void FinishTitles2();
00057 void CreeperDescent();
00058 void CreeperRun2();
00059 void BigBoom();
00060 void BLACKEND();
00061 void StartTitles();
00062 void Credits();
00063 
00064 // Вызовы
00065 
00066 int main()
00067     {
00068     txCreateWindow (1280, 720);
00069     txBegin();
00070 
00071     StartTitles();
00072 
00073     RunToTree();
00074     RunFromTree();
00075     CreeperAppears();
00076     ManTurn();
00077     RunFromCreeper();
00078     Rise1();
00079     Rise2();
00080     CreeperDraw();
00081     CreeperRun();
00082     CreeperJump();
00083     Boom();
00084     AddCrack();
00085     Wait();
00086     DoorOpen();
00087     ManDraw();
00088     Descent1();
00089     Descent2();
00090     RunToTreeNight();
00091     CreepersAdd();
00092     ManTurn2();
00093     CreepersAdd();
00094     ManTurn3();
00095     Booms();
00096 
00097     Clear();
00098     FinishTitles();
00099     FinishTitles2();
00100     CreeperDescent();
00101     CreeperRun2();
00102     BigBoom();
00103 
00104     BLACKEND();
00105 
00106     txEnd();
00107     return 0;
00108     }
00109 
00110 // Функции
00111 
00112 void MainDraw (COLORREF color)
00113     {
00114     txClear();
00115     txSetFillColor (color);
00116     txFloodFill (2, 2);
00117     }
00118 
00119 void Grass (COLORREF color, int Up)
00120     {
00121     txSetColor (TX_BLACK);   // трава
00122     txLine (0, 640 - Up, 1280, 640 - Up);
00123     txLine (0, 660, 1280, 660);
00124     txLine (0, 640, 0, 660);
00125     txLine (1280, 640, 1280, 660);
00126     txSetFillColor (color);
00127     txFloodFill (1, 641);
00128     }
00129 
00130 void Ground (COLORREF color)
00131     {
00132     txSetColor (TX_BLACK);   // земля
00133     txLine (0, 661, 0, 720);
00134     txLine (1280, 661, 1280, 720);
00135     txLine (0, 720, 1280, 720);
00136     txSetFillColor (color);
00137     txFloodFill (1, 661);
00138     }
00139 
00140 void Tree (COLORREF color, int Up, COLORREF Trunk, int UpLeaf, int Width1, int Width2, int Up1, int Up2, int Apples, int R)
00141     {
00142     txSetColor (TX_BLACK);   // дерево
00143     txLine (200, 640, 280, 640);
00144     txLine (200, 640, 200, 400 - Up);
00145     txLine (280, 640, 280, 400 - Up);
00146     txLine (200, 400 - Up, 280, 400 - Up);
00147     txSetFillColor (Trunk);
00148     txFloodFill (201, 639);
00149     txSetColor (TX_BLACK);
00150     txLine (199, 480 - Up2, 40 - Width2, 480 - Up2);
00151     txLine (40 - Width2, 480 - Up2, 40 - Width2, 320);
00152     txLine (40 - Width2, 320, 120, 320);
00153     txLine (120 , 320, 120, 240 - UpLeaf);
00154     txLine (120, 240 - UpLeaf, 360, 240 - UpLeaf);
00155     txLine (360, 240 - UpLeaf, 360, 320);
00156     txLine (360, 320, 440 + Width1, 320);
00157     txLine (440 + Width1, 320, 440 + Width1, 480 - Up1);
00158     txLine (440 + Width1, 480 - Up1, 280, 480 - Up1);
00159     txSetFillColor (color);
00160     txFloodFill (381, 479);
00161 
00162     txSetColor (RGB (229, 38, 24));
00163     txCircle (185 * Apples, 280 * Apples, R * Apples);
00164     txCircle (325 * Apples, 350 * Apples, R * Apples);
00165     txCircle (410 * Apples, 410 * Apples, R * Apples);
00166     txCircle (130 * Apples, 430 * Apples, R * Apples);
00167     txSetFillColor (RGB (229, 38, 24));
00168     txCircle (0, 0, 2);
00169     txFloodFill (185 * Apples, 280 * Apples);
00170     txFloodFill (325 * Apples, 350 * Apples);
00171     txFloodFill (410 * Apples, 410 * Apples);
00172     txFloodFill (130 * Apples, 430 * Apples);
00173     }
00174 
00175 void House (int Open, int Crack, int Pipe, COLORREF ColorSmoke, int Fire, int Height, int Length)
00176     {
00177     txSetColor (TX_BLACK);   // дом
00178     txLine (1120, 640, 1120, 320);
00179     txLine (1120, 320, 1280, 320);
00180     txLine (1500, 320, 1500, 640);
00181     txLine (1500, 640, 1120, 640);
00182     txSetFillColor (RGB (220, 220, 220));
00183     txFloodFill (1121, 639);
00184     txLine (1120, 320, 1040, 320);
00185     txLine (1040, 320, 1040, 300);
00186     txLine (1040, 300, 1060, 300);
00187     txLine (1060, 300, 1060, 280);
00188     txLine (1060, 280, 1080, 280);
00189     txLine (1080, 280, 1080, 260);
00190     txLine (1080, 260, 1100, 260);
00191     txLine (1100, 260, 1100, 240);
00192     txLine (1100, 240, 1500, 240);
00193     txLine (1500, 240, 1500, 320);
00194     txSetFillColor (RGB (238, 197, 145));
00195     txFloodFill (1041, 319);
00196     txLine (1040, 640, 1040, 600);
00197     txLine (1040, 600, 1080, 600);
00198     txLine (1080, 600, 1080, 560);
00199     txLine (1080, 560, 1120, 560);
00200     txLine (1120, 560, 1120, 640);
00201     txLine (1120, 640, 1040, 640);
00202     txSetFillColor (RGB (238, 197, 145));
00203     txFloodFill (1041, 639);
00204     txSetColor (RGB (205, 170, 125));
00205     txLine (1120 - 60 * Open, 560, 1120 - 60 * Open, 400);
00206     txLine (1120 - 60 * Open, 400, 1125 - 5 * Open, 400);
00207     txLine (1125 - 5 * Open, 400, 1125 - 5 * Open, 560);
00208     txLine (1125 - 65 * Open, 560, 1120, 560);
00209     txSetFillColor (RGB (208, 170, 125));
00210     txFloodFill (1121 - 60 * Open, 559);
00211     txFloodFill (1121 - 30 * Open, 559);
00212     txSetColor (TX_BLACK);
00213     txLine (1120, 485, 1115, 485);
00214     txLine (1115, 485, 1115, 480);
00215     txLine (1115, 480, 1120, 480);
00216     txLine (1120, 480, 1120, 485);
00217     txSetFillColor (TX_BLACK);
00218     txFloodFill (1116, 484);
00219     txLine (1200 - Length, 400 - Height, 1360, 400 - Height);
00220     txLine (1360, 400, 1360, 480);
00221     txLine (1360, 480, 1200 - Length, 480);
00222     txLine (1200 - Length, 480, 1200 - Length, 400 - Height);
00223     txSetFillColor (RGB (255, 255, 255));
00224     txFloodFill (1201, 479);
00225 
00226     txLine (1190 * Crack, 515 * Crack, 1250 * Crack, 590 * Crack);
00227     txLine (1250 * Crack, 590 * Crack, 1245 * Crack, 615 * Crack);
00228     txLine (1215 * Crack, 550 * Crack, 1195 * Crack, 590 * Crack);
00229     txLine (1225 * Crack, 560 * Crack, 1250 * Crack, 550 * Crack);
00230 
00231     txLine (1230 * Pipe, 240 * Pipe, 1230 * Pipe, 210 * Pipe);
00232     txLine (1230 * Pipe, 210 * Pipe, 1240 * Pipe, 210 * Pipe);
00233     txLine (1240 * Pipe, 210 * Pipe, 1240 * Pipe, 240 * Pipe);
00234     txLine (1240 * Pipe, 240 * Pipe, 1230 * Pipe, 240 * Pipe);
00235     txSetFillColor (RGB (138, 78, 18));
00236     txFloodFill (1231 * Pipe, 211 * Pipe);
00237 
00238     txSetColor (ColorSmoke);
00239     txLine (1235, 205, 1245, 190);
00240     txLine (1245, 190, 1230, 175);
00241     txLine (1230, 175, 1245, 160);
00242     txLine (1245, 160, 1230, 145);
00243 
00244     txSetColor (TX_BLACK);
00245     txLine (1120, 380, 1100, 340);
00246     txLine (1120, 370, 1110, 340);
00247     txLine (1100, 340, 1110, 340);
00248     txSetFillColor (RGB (138, 78, 18));
00249     txFloodFill (1105, 341);
00250 
00251     txSetColor (RGB (210, 70, 9));
00252     txLine (1102 * Fire, 339 * Fire, 1095 * Fire, 330 * Fire);
00253     txLine (1095 * Fire, 330 * Fire, 1105 * Fire, 325 * Fire);
00254     txLine (1105 * Fire, 325 * Fire, 1115 * Fire, 330 * Fire);
00255     txLine (1115 * Fire, 330 * Fire, 1108 * Fire, 340 * Fire);
00256     txSetFillColor (RGB (210, 70, 9));
00257     txFloodFill (1105 * Fire, 327 * Fire);
00258     }
00259 
00260 void Sun (int x, int y, COLORREF color, double Size, double Length)
00261     {
00262     txSetColor (color);  // солнце
00263     txSetFillColor (color);
00264     txCircle (x + (950 - 950) *Size, y + (90 - 90) *Size, 50 * Size);
00265 
00266     txLine (x + (950 - 950) *Size,  y + (150 - 90) *Size, x + (950 - 950) *Size,  y + (210 - 90) *Size - 25 * Length);
00267     txLine (x + (950 - 950) *Size,  y + (30 - 90) *Size,  x + (950 - 950) *Size,  y + (0 - 90) *Size);
00268     txLine (x + (890 - 950) *Size,  y + (90 - 90) *Size,  x + (830 - 950) *Size + 25 * Length, y + (90 - 90) *Size);
00269     txLine (x + (1010- 950) *Size,  y + (90 - 90) *Size,  x + (1070- 950) *Size - 25 * Length, y + (90 - 90) *Size);
00270     txLine (x + (950 - 950) *Size,  y + (90 - 90) *Size,  x + (860 - 950) *Size + 25 * Length, y + (170- 90) *Size - 25 * Length);
00271     txLine (x + (950 - 950) *Size,  y + (90 - 90) *Size,  x + (1040- 950) *Size - 25 * Length, y + (170- 90) *Size - 25 * Length);
00272     txLine (x + (950 - 950) *Size,  y + (90 - 90) *Size,  x + (860 - 950) *Size + 25 * Length, y + (10 - 90) *Size + 25 * Length);
00273     txLine (x + (950 - 950) *Size,  y + (90 - 90) *Size,  x + (1040- 950) *Size - 25 * Length, y + (10 - 90) *Size + 25 * Length);
00274     }
00275 
00276 void Cloud (int x, int y, COLORREF color, COLORREF colorbg, double Size, int Height, int Length, int Length2)
00277     {
00278     txSetColor (colorbg);  // облако
00279     txLine (x + (230 - 340) *Size, y + (30 - 70) *Size - Height, x + (390 - 340) *Size, y + (30 - 70) *Size - Height) ;
00280     txLine (x + (390 - 340) *Size, y + (30 - 70) *Size - Height, x + (390 - 340) *Size, y + (70 - 70) *Size) ;
00281     txLine (x + (390 - 340) *Size, y + (70 - 70) *Size, x + (430 - 340) *Size + Length, y + (70 - 70) *Size);
00282     txLine (x + (430 - 340) *Size + Length, y + (70 - 70) *Size, x + (430 - 340) *Size + Length, y + (110 - 70) *Size);
00283     txLine (x + (430 - 340) *Size + Length, y + (110 - 70) *Size, x + (270 - 340) *Size, y + (110 - 70) *Size);
00284     txLine (x + (270 - 340) *Size, y + (110 - 70) *Size, x + (270 - 340) *Size, y + (70 - 70) *Size - Length2);
00285     txLine (x + (270 - 340) *Size, y + (70 - 70) *Size - Length2, x + (230 - 340) *Size, y + (70 - 70) *Size - Length2);
00286     txLine (x + (230 - 340) *Size, y + (70 - 70) *Size - Length2, x + (230 - 340) *Size, y + (30 - 70) *Size - Height) ;
00287     txSetFillColor (color);
00288     txFloodFill (x + (250 - 340) *Size, y + (40 - 70) *Size);
00289     }
00290 
00291 void Creeper (int x, int y, double Size, COLORREF color, int Eye, COLORREF EyeColor, int Neck, COLORREF Foot)
00292     {
00293     txLine (x + (590 - 620) *Size, y + (640 - 590) *Size, x + (590 - 620) *Size, y + (610 - 590) *Size); // крипер
00294     txLine (x + (590 - 620) *Size, y + (610 - 590) *Size, x + (610 - 620) *Size, y + (610 - 590) *Size);
00295     txLine (x + (610 - 620) *Size, y + (610 - 590) *Size, x + (610 - 620) *Size, y + (640 - 590) *Size);
00296 
00297     txLine (x + (610 - 620) *Size, y + (640 - 590) *Size * Neck, x + (590 - 620) *Size, y + (640 - 590) *Size * Neck);
00298     txLine (x + (610 - 620) *Size, y + (610 - 590) *Size * Neck, x + (630 - 620) *Size, y + (610 - 590) *Size * Neck);
00299     txLine (x + (630 - 620) *Size, y + (610 - 590) *Size * Neck, x + (650 - 620) *Size, y + (610 - 590) *Size * Neck);
00300     txLine (x + (650 - 620) *Size, y + (610 - 590) *Size * Neck, x + (650 - 620) *Size, y + (640 - 590) *Size * Neck);
00301     txLine (x + (650 - 620) *Size, y + (640 - 590) *Size * Neck, x + (630 - 620) *Size, y + (640 - 590) *Size * Neck);
00302     txLine (x + (630 - 620) *Size, y + (640 - 590) *Size * Neck, x + (630 - 620) *Size, y + (610 - 590) *Size * Neck);
00303     txLine (x + (630 - 620) *Size, y + (610 - 590) *Size * Neck, x + (630 - 620) *Size, y + (560 - 590) *Size * Neck);
00304     txLine (x + (630 - 620) *Size, y + (560 - 590) *Size * Neck, x + (610 - 620) *Size, y + (560 - 590) *Size * Neck);
00305     txLine (x + (610 - 620) *Size, y + (560 - 590) *Size * Neck, x + (610 - 620) *Size, y + (610 - 590) *Size * Neck);
00306     txLine (x + (610 - 620) *Size, y + (560 - 590) *Size * Neck, x + (600 - 620) *Size, y + (560 - 590) *Size * Neck);
00307     txLine (x + (600 - 620) *Size, y + (560 - 590) *Size * Neck, x + (600 - 620) *Size, y + (520 - 590) *Size * Neck);
00308     txLine (x + (600 - 620) *Size, y + (520 - 590) *Size * Neck, x + (640 - 620) *Size, y + (520 - 590) *Size * Neck);
00309     txLine (x + (640 - 620) *Size, y + (520 - 590) *Size * Neck, x + (640 - 620) *Size, y + (560 - 590) *Size * Neck);
00310     txLine (x + (640 - 620) *Size, y + (560 - 590) *Size * Neck, x + (630 - 620) *Size, y + (560 - 590) *Size * Neck);
00311     txLine (x + (590 - 620) *Size, y + (635 - 590) *Size, x + (610 - 620) *Size, y + (635 - 590) *Size);
00312     txLine (x + (630 - 620) *Size, y + (635 - 590) *Size, x + (650 - 620) *Size, y + (635 - 590) *Size);
00313     txSetColor (TX_BLACK);
00314 
00315     txLine (x - 15 * Eye, y - 65 * Eye, x - 10 * Eye, y - 65 * Eye);
00316     txLine (x - 10 * Eye, y - 65 * Eye, x - 10 * Eye, y - 60 * Eye);
00317     txLine (x - 10 * Eye, y - 60 * Eye, x - 15 * Eye, y - 60 * Eye);
00318     txLine (x - 15 * Eye, y - 60 * Eye, x - 15 * Eye, y - 65 * Eye);
00319 
00320     txLine (x + 15 * Eye, y - 65 * Eye, x + 10 * Eye, y - 65 * Eye);
00321     txLine (x + 10 * Eye, y - 65 * Eye, x + 10 * Eye, y - 60 * Eye);
00322     txLine (x + 10 * Eye, y - 60 * Eye, x + 15 * Eye, y - 60 * Eye);
00323     txLine (x + 15 * Eye, y - 60 * Eye, x + 15 * Eye, y - 65 * Eye);
00324 
00325     txSetFillColor (EyeColor);
00326     txFloodFill ( (x - 14) *Eye, (y - 64) *Eye);
00327     txFloodFill ( (x + 14) *Eye, (y - 64) *Eye);
00328 
00329     txSetFillColor (Foot);
00330     txFloodFill (x + (591 - 620) *Size, y + (636 - 590) *Size);
00331     txFloodFill (x + (631 - 620) *Size, y + (636 - 590) *Size);
00332     txSetFillColor (color);
00333     txFloodFill (x + (591 - 620) *Size, y + (611 - 590) *Size);
00334     txFloodFill (x + (631 - 620) *Size, y + (611 - 590) *Size);
00335     txFloodFill (x + (611 - 620) *Size, y + (609 - 590) *Size);
00336     txFloodFill (x + (601 - 620) *Size, y + (559 - 590) *Size);
00337     }
00338 
00339 void Scenery()
00340     {
00341     Grass (RGB (50, 205, 50), 0);
00342     Ground (RGB (136, 69, 19));
00343     Tree (RGB (84, 139, 84), 10, RGB (184, 134, 11), 50, 20, 0, 0, 10, 0, 10);
00344     House (0, 0, 1, TX_BLACK, 1, 10, 15);
00345     }
00346 
00347 void Scenery2()
00348     {
00349     Grass (RGB (50, 205, 50), 0);
00350     Ground (RGB (136, 69, 19));
00351     Tree (RGB (84, 139, 84), 10, RGB (184, 134, 11), 50, 20, 0, 0, 10, 1, 10);
00352     }
00353 
00354 void Scenery3()
00355     {
00356     Grass (RGB (50, 205, 50), 0);
00357     Ground (RGB (136, 69, 19));
00358     Tree (RGB (84, 139, 84), 10, RGB (184, 134, 11), 50, 20, 0, 0, 10, 1, 10);
00359     House (0, 0, 1, TX_BLACK, 1, 10, 15);
00360     }
00361 
00362 void Scenery4()
00363     {
00364     Grass (RGB (50, 205, 50), 0);
00365     Ground (RGB (136, 69, 19));
00366     Tree (RGB (84, 139, 84), 10, RGB (184, 134, 11), 50, 20, 0, 0, 10, 0, 10);
00367     }
00368 
00369 void Man (int x, int y, double Size, int Turn, COLORREF pants, COLORREF shirt, COLORREF Hair, double PantsUp)
00370     {
00371     txLine (x + (800 - 810) *Size * Turn, y + (640 - 570) *Size, x + (800 - 810) *Size * Turn, y + (520 - 570) *Size); // человек
00372     txLine (x + (800 - 810) *Size * Turn, y + (520 - 570) *Size, x + (821 - 810) *Size * Turn, y + (520 - 570) *Size);
00373     txLine (x + (820 - 810) *Size * Turn, y + (640 - 570) *Size, x + (820 - 810) *Size * Turn, y + (540 - 570) *Size);
00374     txLine (x + (800 - 810) *Size * Turn, y + (580 - 570) *Size * PantsUp, x + (820 - 810) *Size * Turn, y + (580 - 570) *Size * PantsUp);
00375     txLine (x + (800 - 810) *Size * Turn, y + (635 - 570) *Size, x + (820 - 810) *Size * Turn, y + (635 - 570) *Size);
00376     txLine (x + (800 - 810) *Size * Turn, y + (640 - 570) *Size, x + (820 - 810) *Size * Turn, y + (640 - 570) *Size);
00377     txLine (x + (800 - 810) *Size * Turn, y + (520 - 570) *Size, x + (790 - 810) *Size * Turn, y + (520 - 570) *Size);
00378     txLine (x + (790 - 810) *Size * Turn, y + (520 - 570) *Size, x + (790 - 810) *Size * Turn, y + (480 - 570) *Size);
00379     txLine (x + (790 - 810) *Size * Turn, y + (480 - 570) *Size, x + (830 - 810) *Size * Turn, y + (480 - 570) *Size);
00380     txLine (x + (830 - 810) *Size * Turn, y + (480 - 570) *Size, x + (830 - 810) *Size * Turn, y + (520 - 570) *Size);
00381     txLine (x + (830 - 810) *Size * Turn, y + (520 - 570) *Size, x + (820 - 810) *Size * Turn, y + (520 - 570) *Size);
00382     txLine (x + (820 - 810) *Size * Turn, y + (520 - 570) *Size, x + (850 - 810) *Size * Turn, y + (550 - 570) *Size);
00383     txLine (x + (800 - 810) *Size * Turn, y + (520 - 570) *Size, x + (840 - 810) *Size * Turn, y + (560 - 570) *Size);
00384     txLine (x + (850 - 810) *Size * Turn, y + (550 - 570) *Size, x + (839 - 810) *Size * Turn, y + (561 - 570) *Size);
00385     txLine (x + (790 - 810) *Size * Turn, y + (495 - 570) *Size, x + (800 - 810) *Size * Turn, y + (495 - 570) *Size);
00386     txLine (x + (800 - 810) *Size * Turn, y + (495 - 570) *Size, x + (800 - 810) *Size * Turn, y + (490 - 570) *Size);
00387     txLine (x + (800 - 810) *Size * Turn, y + (490 - 570) *Size, x + (830 - 810) *Size * Turn, y + (490 - 570) *Size);
00388     txSetFillColor (TX_BLACK);
00389     txFloodFill (x + (801 - 810) *Size * Turn, y + (639 - 570) *Size);
00390     txSetFillColor (pants);
00391     txFloodFill (x + (801 - 810) *Size * Turn, y + (634 - 570) *Size);
00392     txSetFillColor (shirt);
00393     txFloodFill (x + (801 - 810) *Size * Turn, y + (559 - 570) *Size);
00394     txSetFillColor (RGB (222, 184, 135));
00395     txFloodFill (x + (820 - 810) *Size * Turn, y + (536 - 570) *Size);
00396     txFloodFill (x + (829 - 810) *Size * Turn, y + (491 - 570) *Size);
00397     txSetFillColor (Hair);
00398     txFloodFill (x + (791 - 810) *Size * Turn, y + (494 - 570) *Size);
00399     }
00400 
00401 void Boom (int x, int y, COLORREF color, double Size, double Length)
00402     {
00403     txSetColor (color);  // Бум!
00404     txSelectFont ("Times New Roman", 40 * Size);
00405     txTextOut (x + (900 - 950) *Size, y + (70 - 90) *Size, "BOOM!");
00406 
00407     txLine (x + (950 - 950) *Size,  y + (150 - 90) *Size, x + (950 - 950) *Size,  y + (210 - 90) *Size - 25 * Length);
00408     txLine (x + (950 - 950) *Size,  y + (30 - 90) *Size,  x + (950 - 950) *Size,  y + (0 - 90) *Size);
00409     txLine (x + (890 - 950) *Size,  y + (90 - 90) *Size,  x + (830 - 950) *Size + 25 * Length,  y + (90 - 90) *Size);
00410     txLine (x + (1010 - 950) *Size, y + (90 - 90) *Size,  x + (1070 - 950) *Size - 25 * Length, y + (90 - 90) *Size);
00411     txLine (x + (950 - 950) *Size,  y + (90 - 90) *Size,  x + (860 - 950) *Size + 25 * Length,  y + (170 - 90) *Size - 25 * Length);
00412     txLine (x + (950 - 950) *Size,  y + (90 - 90) *Size,  x + (1040 - 950) *Size - 25 * Length, y + (170 - 90) *Size - 25 * Length);
00413     txLine (x + (950 - 950) *Size,  y + (90 - 90) *Size,  x + (860 - 950) *Size + 25 * Length,  y + (10 - 90) *Size + 25 * Length);
00414     txLine (x + (950 - 950) *Size,  y + (90 - 90) *Size,  x + (1040 - 950) *Size - 25 * Length, y + (10 - 90) *Size + 25 * Length);
00415     }
00416 
00417 // Сцены
00418 
00419 void RunToTree()
00420     {
00421     int t = 0;
00422 
00423     while (t <= 100)
00424         {
00425         txClear();
00426         Scenery3();
00427 
00428         Cloud (340 - t * 8, 70, TX_WHITE, TX_BLACK, 1.2, 0, 30, 15);
00429         Cloud (750 - t * 10, 160, RGB (247, 245, 245), TX_BLACK, 1, 20, 0, 0);
00430 
00431         Man (810 - 3 * t, 570 - t % 10, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00432         Sun (1150 + (int) (1.4 * t), 90 + (int) (0.1 * t), RGB (247, 225, 82), 1, 0);
00433         txSetFillColor (RGB (175 - t, 238 - t, 238 - t));
00434         txFloodFill (5, 5);
00435 
00436         txSleep (100);
00437         t++;
00438         }
00439     }
00440 
00441 void RunFromTree()
00442     {
00443     int t = 0;
00444 
00445     while (t <= 80)
00446         {
00447         txClear();
00448         Scenery();
00449 
00450         txSetColor (TX_BLACK);
00451         Man (510 + 3 * t, 570 - t % 10, 1, 1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00452         Sun (1290 + (int) (1.4 * t), 100 + (int) (0.1 * t), RGB (247, 225, 82), 1, 0);
00453         txSetFillColor (RGB (75 - 0.95 * t, 138 - t, 138 - t));
00454         txFloodFill (5, 5);
00455 
00456         txSleep (100);
00457         t++;
00458         }
00459     }
00460 
00461 void CreeperAppears()
00462     {
00463     int t = 0;
00464 
00465     while (t <= 10)
00466         {
00467         txClear();
00468         Scenery();
00469 
00470         txSetColor (TX_BLACK);
00471         Man (750 + 3 * t, 570 - t % 10, 1, 1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00472         txSetColor (TX_BLACK);
00473         Creeper (420 + 4 * t, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00474         txSetFillColor (RGB (0, 58, 58));
00475         txFloodFill (5, 5);
00476 
00477         txSleep (100);
00478         t++;
00479         }
00480     }
00481 
00482 void ManTurn()
00483     {
00484     int t = 0;
00485 
00486     while (t <= 5)
00487         {
00488         txClear();
00489         Scenery();
00490 
00491         txSetColor (TX_BLACK);
00492         Man (780, 570, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00493         Creeper (460, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00494         txSetFillColor (RGB (0, 58, 58));
00495         txFloodFill (5, 5);
00496 
00497         txSleep (100);
00498         t++;
00499         }
00500     }
00501 
00502 void RunFromCreeper()
00503     {
00504     int t = 0;
00505 
00506     while (t <= 50)
00507         {
00508         txClear();
00509         Scenery();
00510 
00511         txSetColor (TX_BLACK);
00512         Man (780 + 5 * t, 570 - t % 15, 1, 1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00513         txSetColor (TX_BLACK);
00514         Creeper (460 + 5 * t, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00515         txSetFillColor (RGB (0, 58, 58));
00516         txFloodFill (5, 5);
00517 
00518         txSleep (100);
00519         t++;
00520         }
00521     }
00522 
00523 void Rise1()
00524     {
00525     int t = 0;
00526 
00527     while (t <= 1)
00528         {
00529         txClear();
00530         Scenery();
00531 
00532         txSetColor (TX_BLACK);
00533         Man (1050, 530, 1, 1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00534         txSetColor (TX_BLACK);
00535         Creeper (720, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00536         txSetFillColor (RGB (0, 58, 58));
00537         txFloodFill (5, 5);
00538 
00539         txSleep (100);
00540         t++;
00541         }
00542     }
00543 
00544 void Rise2()
00545     {
00546     int t = 0;
00547 
00548     while (t <= 2)
00549         {
00550         txClear();
00551         Scenery();
00552 
00553         txSetColor (TX_BLACK);
00554         Creeper (730, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00555         House (1, 0, 1, TX_BLACK, 1, 10, 15);
00556         txSetFillColor (RGB (0, 58, 58));
00557         txFloodFill (5, 5);
00558 
00559         txSleep (100);
00560         t++;
00561         }
00562     }
00563 
00564 void CreeperDraw()
00565     {
00566     int t = 0;
00567 
00568     while (t <= 5)
00569         {
00570         txClear();
00571         Scenery();
00572 
00573         txSetColor (TX_BLACK);
00574         Creeper (740, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00575         txSetFillColor (RGB (0, 58, 58));
00576         txFloodFill (5, 5);
00577 
00578         txSleep (100);
00579         t++;
00580         }
00581     }
00582 
00583 void CreeperRun()
00584     {
00585     int t = 0;
00586 
00587     while (t <= 80)
00588         {
00589         txClear();
00590         Scenery();
00591 
00592         txSetColor (TX_BLACK);
00593         Creeper (740 + t * 3, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00594         txSetFillColor (RGB (0, 58, 58));
00595         txFloodFill (5, 5);
00596 
00597         txSleep (100);
00598         t++;
00599         }
00600     }
00601 
00602 void CreeperJump()
00603     {
00604     int t = 0;
00605 
00606     while (t <= 30)
00607         {
00608         txClear();
00609         Scenery();
00610 
00611         txSetColor (TX_BLACK);
00612         Creeper (980, 590 - t % 5, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00613         txSetFillColor (RGB (0, 58, 58));
00614         txFloodFill (5, 5);
00615 
00616         txSleep (100);
00617         t++;
00618         }
00619     }
00620 
00621 void Boom()
00622     {
00623     int t = 0;
00624 
00625     while (t <= 5)
00626         {
00627         txClear();
00628         Scenery();
00629 
00630         Boom (980, 550, RGB (230, 127, 24), 1, 1);
00631         txSetFillColor (RGB (0, 58, 58));
00632         txFloodFill (5, 5);
00633 
00634         txSleep (100);
00635         t++;
00636         }
00637     }
00638 
00639 void AddCrack()
00640     {
00641     int t = 0;
00642 
00643     while (t <= 10)
00644         {
00645         txClear();
00646         Scenery4();
00647 
00648         txSetColor (TX_BLACK);
00649         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00650         txSetFillColor (RGB (0, 58, 58));
00651         txFloodFill (5, 5);
00652 
00653         txSleep (100);
00654         t++;
00655         }
00656     }
00657 
00658 void Wait()
00659     {
00660     int t = 0;
00661 
00662     while (t <= 20)
00663         {
00664         txClear();
00665         Scenery2();
00666 
00667         txSetColor (TX_BLACK);
00668         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00669         txSetFillColor (RGB (0, 58, 58));
00670         txFloodFill (5, 5);
00671 
00672         txSleep (100);
00673         t++;
00674         }
00675     }
00676 
00677 void DoorOpen()
00678     {
00679     int t = 0;
00680 
00681     while (t <= 2)
00682         {
00683         txClear();
00684         Scenery2();
00685 
00686         txSetColor (TX_BLACK);
00687         House (1, 1, 1, TX_BLACK, 0, 10, 15);
00688         txSetFillColor (RGB (0, 58, 58));
00689         txFloodFill (5, 5);
00690 
00691         txSleep (100);
00692         t++;
00693         }
00694     }
00695 
00696 void ManDraw()
00697     {
00698     int t = 0;
00699 
00700     while (t <= 2)
00701         {
00702         txClear();
00703         Scenery2();
00704 
00705         txSetColor (TX_BLACK);
00706         Man (1080, 490, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00707         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00708         txSetColor (TX_BLACK);
00709         txSetFillColor (RGB (0, 58, 58));
00710         txFloodFill (5, 5);
00711 
00712         txSleep (100);
00713         t++;
00714         }
00715     }
00716 
00717 void Descent1()
00718     {
00719     int t = 0;
00720 
00721     while (t <= 2)
00722         {
00723         txClear();
00724         Scenery2();
00725 
00726         txSetColor (TX_BLACK);
00727         Man (1050, 530, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00728         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00729         txSetColor (TX_BLACK);
00730         txSetFillColor (RGB (0, 58, 58));
00731         txFloodFill (5, 5);
00732 
00733         txSleep (100);
00734         t++;
00735         }
00736     }
00737 
00738 void Descent2()
00739     {
00740     int t = 0;
00741 
00742     while (t <= 2)
00743         {
00744         txClear();
00745         Scenery2();
00746 
00747         txSetColor (TX_BLACK);
00748         Man (1020, 570, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00749         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00750         txSetColor (TX_BLACK);
00751         txSetFillColor (RGB (0, 58, 58));
00752         txFloodFill (5, 5);
00753 
00754         txSleep (100);
00755         t++;
00756         }
00757     }
00758 
00759 void RunToTreeNight()
00760     {
00761     int t = 0;
00762 
00763     while (t <= 50)
00764         {
00765         txClear();
00766         Scenery2();
00767 
00768         txSetColor (TX_BLACK);
00769         Man (1020 - 5 * t, 570 - t % 5, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00770         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00771         txSetColor (TX_BLACK);
00772         txSetFillColor (RGB (0, 58, 58));
00773         txFloodFill (5, 5);
00774 
00775         txSleep (100);
00776         t++;
00777         }
00778     }
00779 
00780 void CreepersAdd()
00781     {
00782     int t = 0;
00783 
00784     while (t <= 3)
00785         {
00786         txClear();
00787         Scenery2();
00788 
00789         txSetColor (TX_BLACK);
00790         Man (770, 570, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00791         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00792         txSetColor (TX_BLACK);
00793         Creeper (560, 580, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00794         Creeper (610, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00795         Creeper (520, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00796         txSetFillColor (RGB (0, 58, 58));
00797         txFloodFill (5, 5);
00798 
00799         txSleep (100);
00800         t++;
00801         }
00802     }
00803 
00804 void ManTurn2()
00805     {
00806     int t = 0;
00807 
00808     while (t <= 3)
00809         {
00810         txClear();
00811         Scenery2();
00812 
00813         txSetColor (TX_BLACK);
00814         Man (770, 570, 1, 1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00815         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00816         txSetColor (TX_BLACK);
00817         Creeper (560, 580, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00818         Creeper (610, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00819         Creeper (520, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00820         txSetFillColor (RGB (0, 58, 58));
00821         txFloodFill (5, 5);
00822 
00823         txSleep (100);
00824         t++;
00825         }
00826     }
00827 
00828 void CreepersAdd2()
00829     {
00830     int t = 0;
00831 
00832     while (t <= 3)
00833         {
00834         txClear();
00835         Scenery2();
00836 
00837         txSetColor (TX_BLACK);
00838         Man (770, 570, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00839         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00840         txSetColor (TX_BLACK);
00841         Creeper (560, 580, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00842         Creeper (610, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00843         Creeper (520, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00844 
00845         Creeper (920, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00846         Creeper (970, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00847         Creeper (880, 570, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00848         Creeper (1040, 550, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00849         txSetFillColor (RGB (0, 58, 58));
00850         txFloodFill (5, 5);
00851 
00852         txSleep (100);
00853         t++;
00854         }
00855     }
00856 
00857 void ManTurn3()
00858     {
00859     int t = 0;
00860 
00861     while (t <= 3)
00862         {
00863         txClear();
00864         Scenery2();
00865 
00866         txSetColor (TX_BLACK);
00867         Man (770, 570, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00868         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00869         txSetColor (TX_BLACK);
00870         Creeper (560, 580, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00871         Creeper (610, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00872         Creeper (520, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00873 
00874         Creeper (920, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00875         Creeper (970, 590, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00876         Creeper (880, 570, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00877         Creeper (1040, 550, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
00878         txSetFillColor (RGB (0, 58, 58));
00879         txFloodFill (5, 5);
00880 
00881         txSleep (100);
00882         t++;
00883         }
00884     }
00885 
00886 void Booms()
00887     {
00888     int t = 0;
00889 
00890     while (t <= 3)
00891         {
00892         txClear();
00893         Scenery2();
00894 
00895         txSetColor (TX_BLACK);
00896         Man (770, 570, 1, -1, RGB (33, 29, 146), RGB (30, 148, 178), RGB (139, 69, 19), 1);
00897         House (0, 1, 1, TX_BLACK, 0, 10, 15);
00898         txSetColor (TX_BLACK);
00899 
00900         Boom (560, 580, RGB (230, 127, 24), 1, 1);
00901         Boom (610, 590, RGB (230, 127, 24), 1, 1);
00902         Boom (520, 590, RGB (230, 127, 24), 1, 1);
00903 
00904         Boom (920, 590, RGB (230, 127, 24), 1, 1);
00905         Boom (970, 590, RGB (230, 127, 24), 1, 1);
00906         Boom (880, 570, RGB (230, 127, 24), 1, 1);
00907         Boom (1040, 550, RGB (230, 127, 24), 1, 1);
00908 
00909         txSetFillColor (RGB (0, 58, 58));
00910         txFloodFill (5, 5);
00911 
00912         txSleep (100);
00913         t++;
00914         }
00915     }
00916 
00917 void Clear()
00918     {
00919     txClear();
00920     Grass (RGB (50, 205, 50), 0);
00921     Ground (RGB (136, 69, 19));
00922     txSetFillColor (RGB (0, 58, 58));
00923     txFloodFill (5, 5);
00924     }
00925 
00926 void FinishTitles()
00927     {
00928     int t = 0;
00929 
00930     while (t <= 5)
00931         {
00932         txClear();
00933         Grass (RGB (50, 205, 50), 0);
00934         Ground (RGB (136, 69, 19));
00935         txSetFillColor (RGB (0, 58, 58));
00936         txFloodFill (5, 5);
00937         txSetColor (TX_WHITE);
00938         txSelectFont ("Berlin Sans FB Demi", 200);
00939         txTextOut (420, 160, "THE END!");
00940         txSleep (100);
00941         t++;
00942         }
00943     }
00944 
00945 void Credits()
00946     {
00947     txSetColor (TX_WHITE);
00948     txSelectFont ("Berlin Sans FB Demi", 50);
00949     txTextOut (420, 160, "Мультик сделан Васильевым Валерой");
00950     txTextOut (570, 210, "в 2013 году,");
00951     txTextOut (490, 260, "по мотивам игры Minecraft");
00952     }
00953 
00954 void FinishTitles2()
00955     {
00956     int t = 0;
00957 
00958     while (t <= 10)
00959         {
00960         txClear();
00961         Grass (RGB (50, 205, 50), 0);
00962         Ground (RGB (136, 69, 19));
00963         txSetFillColor (RGB (0, 58, 58));
00964         txFloodFill (5, 5);
00965 
00966         Credits();
00967 
00968         txSleep (100);
00969         t++;
00970         }
00971     }
00972 
00973 void StartTitles()
00974     {
00975     int t = 0;
00976 
00977     while (t <= 85)
00978         {
00979         txClear();
00980         Grass (RGB (50, 205, 50), 0);
00981         Ground (RGB (136, 69, 19));
00982         txSetFillColor (RGB (175, 238, 238));
00983         txFloodFill (5, 5);
00984         txSetColor (TX_BLACK);
00985         txSelectFont ("Impact", 200);
00986         txTextOut (-700 + t * 10, 100, "Minecraft");
00987         txSetColor (TX_BLACK);
00988         txSelectFont ("Gabriola", 200);
00989         txTextOut (2000 - t * 15, 250, "Story");
00990         txSleep (100);
00991         t++;
00992         }
00993 
00994     txSleep (3000);
00995     }
00996 
00997 void CreeperDescent()
00998     {
00999     int t = 0;
01000 
01001     while (t <= 12)
01002         {
01003         txClear();
01004         Grass (RGB (50, 205, 50), 0);
01005         Ground (RGB (136, 69, 19));
01006 
01007         Credits();
01008 
01009         txSetColor (TX_BLACK);
01010         Creeper (500, 0 + 10 * t, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
01011         txSetFillColor (RGB (0, 58, 58));
01012         txFloodFill (5, 5);
01013 
01014         txSleep (100);
01015         t++;
01016         }
01017     }
01018 
01019 void CreeperRun2()
01020     {
01021     int t = 0;
01022 
01023     while (t <= 30)
01024         {
01025         txClear();
01026         Grass (RGB (50, 205, 50), 0);
01027         Ground (RGB (136, 69, 19));
01028 
01029         Credits();
01030 
01031         txSetColor (TX_BLACK);
01032         Creeper (500 + 5 * t, 120 - t % 5, 1, RGB (69, 139, 0), 1, TX_BLACK, 1, TX_BLACK);
01033         txSetFillColor (RGB (0, 58, 58));
01034         txFloodFill (5, 5);
01035 
01036         txSleep (100);
01037         t++;
01038         }
01039     }
01040 
01041 void BigBoom()
01042     {
01043     int t = 0;
01044 
01045     while (t <= 3)
01046         {
01047         txClear();
01048         Grass (RGB (50, 205, 50), 0);
01049         Ground (RGB (136, 69, 19));
01050 
01051         Credits();
01052 
01053         Boom (650, 120, RGB (230, 127, 24), 2, 1);
01054         txSetFillColor (RGB (0, 58, 58));
01055         txFloodFill (5, 5);
01056 
01057         txSleep (100);
01058         t++;
01059         }
01060     }
01061 
01062 void BLACKEND()
01063     {
01064     txClear();
01065     txSetFillColor (TX_BLACK);
01066     txFloodFill (5, 5);
01067     }