/
n-dimens
/
pascalabcnet
Обзор
Документация
Войти
/
n-dimens
/
pascalabcnet
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
3.0
TestSamples/CompilationSamples/Timer2.pas
62 строки
851 B
Бондарев Иван
initial commit
14 май 2015, 22:35
14 май 2015, 22:35
e6e67c1
Код
Авторство
О чём код?
// "�������". ����������� ������������� �������. uses GraphABC, Timers; var t: Timer; xx,yy,px,py: integer; procedure Draw; begin Circle(xx,yy,5); end; procedure Show; begin SetPenColor(clBlack); SetBrushColor(clBlack); Draw; end; procedure Hide; begin SetPenColor(clWhite); SetBrushColor(clWhite); Draw; end; procedure Move(x,y: integer); begin Hide; xx:=x; yy:=y; show; end; procedure Timer1; var t: real; newx,newy: integer; begin if (xx<>px) or (yy<>py) then begin t:=1/10; newx:=round((1-t)*xx+t*px); newy:=round((1-t)*yy+t*py); Move(newx,newy); end; end; procedure MouseMove(x,y,mb: integer); begin px:=x; py:=y; end; begin SetWindowCaption('"�������"'); OnMouseMove:=MouseMove; xx:=100; yy:=100; px:=xx; py:=yy; Show; Timer1; t := new Timer(20,Timer1); t.Start; end.