Курсовая работа: Система координат канви
b = Ball->Items[cur];
}while( b->exist);
Cue->ToBall = b; }
b->dx = b->dx*mu;
b->dy = b->dy*mu;
if((b->x+b->dx > BilliardTable->Right-b->R)
|| (b->x+b->dx < BilliardTable->Left+b->R)
b->dx = -b->dx * mu;
b->x = b->x + b->dx;
if((b->y+b->dy > BilliardTable->Bottom-b->R)
|| (b->y+b->dy < BilliardTable->Top+b->R)
b->dy = -b->dy * mu;
b->y = b->y + b->dy;
b2 = b->collisedWith;
b->outFrom(b2);
d = sqrt(sqr(b->dx)+sqr(b->dy));
if(d < MovementLimit )
{ b->Stop; }
Cue->energy = Trunc(MaxEnergy/2*cos(tick/5)+MaxEnergy/2)+1; }
allstopped = True;
for( i = 0; i <=Ball->Count - 1; i ++)
{ b = Ball->Items[i];
allstopped = (b->dx == 0) && (b->dy == 0) && allstopped; }
if(allstopped && MovedLater )
{ Cue->visible = True;
if(ballsIn == 0
then Player = 1 - Player;
if(Player == 1 ) ComputerMove;
ballsIn = 0; }