Курсовая работа: Система координат канви
BallsInMove = !allStopped;
Draw; } }}
void __fastcall TForm1::FormKeyPress(TObject *Sender, char &Key)
{ if(BallsInMove ) exit;
if(Key in ["i", "I"] )
{ ShowID = ! ShowID; }
if(Player == 1 ) exit;// нельзя управлять во время хода компьютера!
if(Key in ["h", "H"] then ComputerMove;// help me!}
void __fastcall TForm1::FormDestroy(TObject *Sender)
{ INI = TIniFile->Create(ExtractFilePath(ParamStr(0))+"\settings.ini");
INI->Writeint ("Phisics", "ballSize", ballSize);
INI->Writeint ("Phisics", "PocketSize", loseSize);
INI->Writeint ("Phisics", "MaxEnergy", MaxEnergy);
INI->Writeint ("Phisics", "CueLength", CueLength);
INI->Writeint ("Phisics", "PyramidHeight", PyramidHeight);
INI->WriteFloat("Phisics", "Friction", mu);
INI->WriteFloat("Phisics", "AngleStep", Step);
INI->WriteFloat("Phisics", "MovementLimit", MovementLimit);
INI->Writeint ("Phisics", "TimeInterval", Timer1->Interval);}
void __fastcall TForm1::Button1Click(TObject *Sender)
{ int i, j;
pBall b;
pLose luza;
boolean unique, inrect;
randomize;
Player = 0;
CompMove = 0;
Timer1->Enabled = True;
with Image1->Canvas do