Курсовая работа: Система координат канви
Pen->Color = clBlack;
Rectangle(0, 0, Width, Height); }
BilliardTable->Ball->Clear;
BilliardTable->Lose->Clear;
balls = -1;
new(b);
inc(balls);
b->x = BilliardTable->Width / 4 + BilliardTable->Left;
b->y = BilliardTable->Height / 2 + BilliardTable->Top;
b->R = ballSize;//Random(20)+10;
b->col = clLtGray;//Random(clWhite);
b->dx = Random*2-1;
b->dy = Random*2-1;
b->ID = 0;
b->exist = True;
BilliardTable->Ball->Add(b);
PlayerN[0]->balls = 0;
PlayerN[1]->balls = 0;
GameStatus = gsGame;
loses = -1;
for( j = 0; j <=1; j ++)
for( i = -1; i <=1; i ++)
{ new(luza);
inc(loses);
luza->x = BilliardTable->Left + (BilliardTable->Width / 2)*(i+1);
luza->y = BilliardTable->Top + (BilliardTable->Height / 2)*(j*2);
luza->R = loseSize;
if(abs(i)==1 )
{ luza->x = trunc(luza->x - i*luza->R*sqrt(2)/2);