Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses
- GraphABC;
- const
- count = 100;
- Radius = 3;
- disp = 2;
- type
- tPoint = record
- x, y, v : Integer;
- end;
- var
- s : array [1..count] of tPoint;
- w, h: integer;
- begin
- window.SetSize(1000, 600);
- randomize;
- w := 5;
- h := 5;
- for var i := 1 to count do
- begin
- s[i].x := Random(Window.Width);
- s[i].y := Random(Window.Height);
- s[i].v := Random(1, 3);
- end;
- Brush.Color := clWhite;
- while true do
- begin
- LockDrawing;
- clearwindow(clSkyBlue);
- for var i := 1 to count do
- begin
- FillCircle(s[i].x, s[i].y, Radius);
- s[i].y += s[i].v; //снежинки вниз
- if s[i].y > Window.Height then
- begin
- s[i].x := Random(Window.Width);
- s[i].y := 0;
- s[i].v := Random(1, 3);
- end
- else
- s[i].x += Random(-disp, +disp);
- end;
- Redraw;
- sleep(10);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement