unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Timer1: TTimer;
    procedure FormPaint(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;
  offset: integer = 0;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormPaint(Sender: TObject);
var
  x, y, realX, realY: integer;
  c: TColor;
begin
  c := clBlack;

  for x := 0 to 250-1 do begin
    for y := 0 to 100-1 do begin
      if (x mod 50 < 25) = (y mod 30 < 15) then c := clWhite else c := clNavy;

      //realX := 30 + x + y;
      //realY := 30 + 200 - y;

      //realX := 30 + 2*x + 2*y;
      //realY := 30 + 200 - 2*y;

      realX := 30 + 2*x + 2*y;
      realY := 30 + 200 - 2*y - round(10 * cos((x - offset)/10) * cos(y/10));

      Canvas.Pixels[realX, realY] := c;
    end;
  end;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  offset := offset + 1;
  Refresh;
end;

end.

