代码拉取完成,页面将自动刷新
unit tlgUnit;
{$MODE Delphi}
interface
uses
LCLIntf, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, LResources, betterControls;
type
Ttlg = class(TForm)
Image1: TImage;
Label1: TLabel;
Timer1: TTimer;
Label2: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
score: integer;
end;
var
tlg: Ttlg;
implementation
resourcestring
rsYouWin = 'OMG, You must have cheated or don''t have a life. (Although some people claim that thats the same)';
procedure Ttlg.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action:=cafree;
end;
procedure Ttlg.Timer1Timer(Sender: TObject);
begin
image1.Left:=random(width-image1.Width);
image1.Top:=random(height-image1.Height);
if not image1.Visible then image1.Visible:=true;
end;
procedure Ttlg.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
inc(score);
label2.Caption:=IntToStr(score);
image1.Left:=random(width-image1.Width);
image1.Top:=random(height-image1.Height);
timer1.Enabled:=false;
timer1.Interval:=timer1.Interval-100;
if timer1.Interval<=0 then showmessage(rsYouWin);
timer1.Enabled:=true;
end;
initialization
{$i tlgUnit.lrs}
end.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。