Курсовая работа: Система координат канви
luza->ballsInside = 0;
BilliardTable->Lose->Add(luza); }
for( j = 1; j <=PyramidHeight; j ++)
for( i = 1; i <=j; i ++)
{ new(b);
inc(balls);
b->R = ballSize; //Random(20)+10;
b->col = clLtGray; //Random(clWhite);//clLtGray;
b->dx = Random*2-1;
b->dy = Random*2-1;
b->ID = balls;
b->exist = True;
if(j % 2 != 0
then b->y = -((j-1) / 2)*2*b->R+(i-1)*2*b->R + H / 2
else b->y = -((j-1) / 2)*2*b->R+(i-1)*2*b->R - b->R + H / 2;
b->y = b->y + dh;
b->x = (j-1)*2*b->R + 3 * BilliardTable->Width / 4 + dw + LoseSize;
BilliardTable->Ball->Add(b); }
inc(Balls);
BilliardTable->Cue->ToBall = BilliardTable->Ball->Items[0];
BilliardTable->Cue->angle = 180*Pi/180;
BilliardTable->Cue->visible = False;
StopAll;
void __fastcall TForm1::FormCreate(TObject *Sender)
{ INI = TIniFile->Create(ExtractFilePath(ParamStr(0))+"\settings.ini");
ballSize = INI->Readint ("Phisics", "ballSize", 10);
loseSize = INI->Readint ("Phisics", "PocketSize", ballSize + 5);
MaxEnergy = INI->Readint ("Phisics", "MaxEnergy", 20);
CueLength = INI->Readint ("Phisics", "CueLength", 200);