Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

TForm1 *Form1;

TPoint Sun[2];
TPoint Cactus1[4];
TPoint Cactus2[6];
TPoint Cactus3[6];
int flagSun=0;
int radius=50;
double fi1=0;
double fi2=90;
double fi3=180;
double fi4=270;
double Pi = 3.141592654;
double incrs=1;
//ìåòåîðèò
TPoint met[2];
int metAct=0;
int flagMet=0;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
//ðàäèóñ 100
Sun[0].x=1100;
Sun[0].y=150;
Sun[1].x=1200;
Sun[1].y=250;
//îñíîâàíèå êàêòóñà
Cactus1[0].x=100;
Cactus1[0].y=750;
Cactus1[1].x=150;
Cactus1[1].y=750;
Cactus1[2].x=150;
Cactus1[2].y=550;
Cactus1[3].x=100;
Cactus1[3].y=550;
//÷àñòü 1 êàêòóñà
Cactus2[0].x=150;
Cactus2[0].y=700;
Cactus2[1].x=200;
Cactus2[1].y=700;
Cactus2[2].x=200;
Cactus2[2].y=600;
Cactus2[3].x=160;
Cactus2[3].y=600;
Cactus2[4].x=160;
Cactus2[4].y=650;
Cactus2[5].x=100;
Cactus2[5].y=650;
// ÷àñòü 2 êàêòóñà
Cactus3[0].x=100;
Cactus3[0].y=725;
Cactus3[1].x=40;
Cactus3[1].y=725;
Cactus3[2].x=40;
Cactus3[2].y=625;
Cactus3[3].x=70;
Cactus3[3].y=625;
Cactus3[4].x=70;
Cactus3[4
Form1->Canvas->Pen->Color=RGB(255,178,102);
Form1->Canvas->Brush->Color=RGB(255,178,102);
Form1->Canvas->Rectangle(0,700,ClientWidth,ClientHeight);
//êàêòóñ
Form1->Canvas->Pen->Color=RGB(0,102,0);
Form1->Canvas->Brush->Color=RGB(0,102,0);
Form1->Canvas->Polygon(Cactus1,3);
Form1->Canvas->Polygon(Cactus2,5);
Form1->Canvas->Polygon(Cactus3,5);
//âûøêà
Form1->Canvas->Pen->Color=clBlack;
Form1->Canvas->MoveTo(500,750);
Form1->Canvas->LineTo(550,400);
Form,405+radius*cos(fi4 * Pi / 180.0));
//ìåòåîð
Form1->Canvas->Pen->Color=RGB(255,51,51);
//óñëîâèå âîçîáíîâëåíèÿ
if(met[1].y+metAct>Clie
Form1->Canvas-
>Ellipse(met[0].x+metAct,met[0].y+metAct,met[1].x+metAct,met[1].y+metAct);

}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
//ñîëíöå ìàñøòàáèðóåìîå

incrs*=1.01;
fi1-=10;
fi2-=10;
fi3-=10;
fi4-=10;
metAct+=50;
void __fastcall TForm1::FormCreate(TObject *Sender)
{
DoubleBuffered=1;
}
Repaint();
}
//---------------------------------------------------------------------------
#include <vcl.h>

#pragma hdrstop

#include "laba3.h"

#include <math.h>

//---------------------------------------------------------------------------

#pragma pa

double fi4=270;

double Pi = 3.141592654;

TPoint kust[4];

int flagkust=0;

double koeff=1;

kust[3].y=264;

//---------------------------------------------------------------------------

void __fastcall TForm1::FormPaint(TObject *Sender)

{ Form1->Canvas->MoveTo(0,264);

Form1->Canvas->Pen->Color=clBlack;

Form1->Canvas->LineTo(888,264);

Form1->Canvas->Brush->Color=RGB(102,178,255);

Form1->Canvas->Rectangle(0,0,888,264);

Form1->Canvas->Brush->Color=clGreen;
Form1->Canvas->Rectangle(0,264,888,400);

Form1->Canvas->Brush->Color=clYellow;

Form1->Canvas->Ellipse(744-30*koeff,16-30*koeff,824+30*koeff,96+30*koeff);

Form1->Canvas->Pen->Color=clRed;

Form1->Canvas->Brush->Color=RGB(204,102,0);

Form1->Canvas->Pen->Color=clBlack;

TPoint p[12

p[11].x=174; p[11].y=264;

Form1->Canvas->Polygon(p,11);

TPoint p1[5];

p1[0].x=249; p1[0].y=264;

p1[1].x=249; p1[1].y=84;

p1[2].x=274; p1[2].y=64;

p1[3].x=299; p1[3].y=84;

p1[4].x=299; p1[4].y=264;

Form1->Canvas->Polygon(p1,4);

Form1->Canvas->Rectangle(174,124,374,264);

TPoint p2[12];

p2[0].x=3

p2[10].x=424; p2[10].y=84;

p2[11].x=424; p2[11].y=264;

Form1->Canvas->Polygon(p2,11);

Form1->Canvas->MoveTo(274,64);

Form1->Canvas->LineTo(274,34);

Form1->Canvas->Brush->Color=clWhite;

Form1->Canvas->Rectangle(274,34,294,44);
Form1->Canvas->Brush->Color=clBlack;

Form1->Canvas->Rectangle(249,204,299,264);

Form1->Canvas->Pie(249,184,299,224,299,204,249,204);

Form1->Canvas->Brush->Color=RGB(204,102,0);

Form1->Canvas->Rectangle(624,234,654,264);

Form1->Canvas->MoveTo(639,234);

Form1->Canvas->Pen->Color=clYellow;

Form1->Canvas->Pen->Width=3;

Form1->Canvas->LineTo(639,74);

For(550,65,"MARIO");

Form1->Canvas->Brush->Color=RGB(204,102,0);

Form1->Canvas->Pen->Color=clBlack;

Form1->Canvas->Rectangle(0,264,888,314);

Form1->Canvas->Brush->Color=clGreen;

Form1->Canvas->Pie(kust[0].x,kust[0].y,kust[1].x,kust[1].y,kust[2].x,kust[2].y,kust[3].x,kust[3].y);

if(kust[1].x>880)

flagkust=1;

else if (kust[0].x<634)

flagkust=0;

Form1->Canvas->Pie(0,200,100,328,100,264,0,264);

Form1->C

Form1->Canvas->LineTo(639+radius*sin(fi2 * Pi / 180.0),74+radius*cos(fi2 * Pi / 180.0));

Form1->Can

DoubleBuffered=1;

fi1-=10;

fi2-=10;

fi3-=10;

fi4-=10;
if(!flagkust)

kust[0].x++;

kust[1].x++;

kust[2].x++;

kust[3].x++;

else

kust[0].x--;

kust[1].x--;

kust[2].x--;

kust[3].x--;

Repaint();

//---------------------------------------------------------------------------

void __fastcall TForm1::Timer2Timer(TObject *Sender)

koeff*=1.001;

Repaint();

You might also like