0
uses GraphABC,Events;
const r=50; d=15;
var x,y: integer;
procedure Show; begin LockDrawing; SetBrushColor(clBlack); circle(x+r,y+r,20); Redraw; end;
procedure Shw; var x,i,z:integer; a,b,c,d:integer; begin LockDrawing; a:=random(0,255);b:=random(0,255);c:=random(0,255);d:=random(0,255); SetBrushColor(ARGB(a,b,c,d)); SetPenColor(ARGB(a,b,c,d)); circle(random(10,600),random(10,800),random(1,30)); Redraw; end;
procedure KeyDown(Key: integer); begin
case Key of VK_Left: x:=x-d; VK_Up: y:=y-d; VK_Right: x:=x+d; VK_Down: y:=y+d; VK_E: Shw; end;
Show end;
procedure KeyPress(Ch: char); begin end;
begin SetWindowCaption('Нажимайте стрелки для перемещения объекта'); SetPenColor(clWhite); OnKeyDown:=KeyDown;
Show; end.
|