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
|
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <math.h>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int x=200, y=300;
#define MAX_PARTICLES 40
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
WindowState = wsMaximized;
Timer1->Interval = 1000;
randomize();
}
//-----------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
int a=0;
int b=0;
x=200;
y=310;
//Boucle pour tracer l'eau
for(int e=0;e<40;e++)
{
Canvas->Pen->Color = clBlue;
Canvas->Pen->Width = 4;
int Dx=random(10);
int Dy = e;
x=x+Dx;
y=y+Dy;
a=x;
b=y;
Canvas->RoundRect(x, y, x + 4, y +4, Dx/2, Dy/2);
Sleep(3);
Canvas->Pen->Color= clBlue;
Canvas->RoundRect(a,b,a+4,b+4,Dx/2,Dy/2);
Canvas->Pen->Color = clBlue;
Canvas->Pen->Width = 4;
Dx=random(20);
Dy = e;
x=x+Dx;
y=y+Dy;
a=x;
b=y;
Canvas->RoundRect(x, y, x + 4, y +4, Dx/2, Dy/2);
Sleep(5);
Canvas->Pen->Color= clBlue;
Canvas->RoundRect(a,b,a+4,b+4,Dx/2,Dy/2);
Canvas->Pen->Color = clBlue;
Canvas->Pen->Width = 4;
Dx=random(30);
Dy = e;
x=x+Dx;
y=y+Dy;
a=x;
b=y;
Canvas->RoundRect(x, y, x + 4, y +4, Dx/2, Dy/2);
Sleep(4);
Canvas->Pen->Color= clBlue;
Canvas->RoundRect(a,b,a+4,b+4,Dx/2,Dy/2);
}
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
exit(0);
} |