unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer
);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
play: boolean = false;
implementation
{$R *.lfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
play := true;
Label1.Caption := 'Play';
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if play = true then begin
if Image1.Picture.Bitmap.Canvas.Pixels[X, Y] = clBlack then begin
Label1.Caption := 'You looooze';
play := false;
end;
if Image1.Picture.Bitmap.Canvas.Pixels[X, Y] = clYellow then begin
Label1.Caption := 'You WIN!!!';
play := false;
end;
end;
end;
end.