Delphi实现贪吃蛇游戏(2)
2008-04-10 02:57:34来源:互联网 阅读 ()
begin
Timer2.Enabled := false;
end
else
begin
PaintBox1.Canvas.Brush.Color := clsilver;
PaintBox1.Canvas.Rectangle(a,b,a 10,b 10);
timer2.Enabled := true;
end;
end;
好了,完工了。下面把菜单在做一下。
procedure TForm1.Stop1Click(Sender: TObject);
begin
if n = 0 then
begin
Stop1.Caption := ''''Continue'''';
Timer1.Enabled := False;
n := 1;
end
else
begin
Stop1.Caption := ''''Stop'''';
Timer1.Enabled := True;
n := 0;
end;
end;
procedure TForm1.Away1Click(Sender: TObject);
begin
close();
end;
procedure TForm1.One1Click(Sender: TObject);
begin
timer1.Interval := 400;
end;
procedure TForm1.two1Click(Sender: TObject);
begin
timer1.Interval := 150;
end;
procedure TForm1.three1Click(Sender: TObject);
begin
timer1.Interval := 95;
end;
procedure TForm1.Four1Click(Sender: TObject);
begin
timer1.Interval := 50;
end;
然后,在新建一个Form,Form2,Name:=frmAbout.里面加个Label,Label1.写上自己的信息。在代码编辑区里,选择Unit1,在{$R *.dfm}下面加入 Uese Unit2; 单击about,加入代码后为:
procedure TForm1.AboutMe1Click(Sender: TObject);
begin
frmAbout.ShowModal();
end;
至此,全部完工了,共273行代码,不过有一点错误。请各位网友通知我
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:Delphi7的IDE概述(一)
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
