高价寻求VB编程校花的贴身高手答题器制作网游答题器,有...

有偿寻求吧里高手帮忙用VB编译网游答题器【vb吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:102,728贴子:
有偿寻求吧里高手帮忙用VB编译网游答题器收藏
本人没学过VB,吧里有好心人加个qq:.有偿的
吧里的职业高手呢,赚个外快,成不?
什么是网游答题器
大神们,是有偿的,虽然很简单,没什么挑战性,但是大神们踊跃点,中不?
能接吗?感兴趣的话可以细聊,我可以把成品样本传给你,只要达到那个效果就行了
登录百度帐号推荐应用 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
VB程序设计试题库
下载积分:800
内容提示:VB程序设计试题库
文档格式:DOC|
浏览次数:43|
上传日期: 02:58:52|
文档星级:
全文阅读已结束,如果下载本文需要使用
 800 积分
下载此文档
该用户还上传了这些文档
VB程序设计试题库
官方公共微信> 问题详情
求VB制作的小游戏,比如贪吃蛇等,要有工程与代码,最好加上注视
悬赏:90&***豆
提问人:匿名网友
发布时间:
求VB制作的小游戏,比如贪吃蛇等,要有工程与代码,最好加上注视
网友回答(共5条)展开
Windows编程就像是一场由来不久并正在进行着的革命,尽管游戏程序员曾一度拒绝为Windows平台开发,然而正如Brog种族生物所说的那样:抵抗都是徒劳的……。本次内容将带领朋友们开始一段VC游戏开发之旅。 VC作为一个主流的开发平台一直深受编程爱好者的喜爱,但是很多人却对它的入门感到难于上青
&&&&&&&&提问收益:16.80&***豆
给你段代码吧,直接复制粘贴到文本文件,改名为1.frm即可运行(关于连线的判断自己需要加一段算法代码,本程序中没写):
VERSION&5.00
Begin&VB.Form&Form1&
&&&BorderStyle&&&&&=&&&1&&'Fixed&Single
&&&Caption&&&&&&&&&=&&&&Form1&
&&&ClientHeight&&&&=&&&7680
&&&ClientLeft&&&&&&=&&&45
&&&ClientTop&&&&&&&=&&&435
&&&ClientWidth&&&&&=&&&7170
&&&LinkTopic&&&&&&&=&&&&Form1&
&&&MaxButton&&&&&&&=&&&0&&&'False
&&&MinButton&&&&&&&=&&&0&&&'False
&&&ScaleHeight&&&&&=&&&7680
&&&ScaleWidth&&&&&&=&&&7170
&&&StartUpPosition&=&&&3&&'窗口缺省
&&&Begin&VB.Timer&Timer1&
&&&&&&Left&&&&&&&&&&&&=&&&6720
&&&&&&Top&&&&&&&&&&&&&=&&&2880
&&&Begin&boBox&dengji&
&&&&&&Height&&&&&&&&&&=&&&300
&&&&&&Left&&&&&&&&&&&&=&&&4680
&&&&&&Style&&&&&&&&&&&=&&&2&&'Dropdown&List
&&&&&&TabIndex&&&&&&&&=&&&6
&&&&&&Top&&&&&&&&&&&&&=&&&720
&&&&&&Width&&&&&&&&&&&=&&&1935
&&&Begin&mandButton&Jieshu&
&&&&&&Caption&&&&&&&&&=&&&&结束游戏&
&&&&&&Height&&&&&&&&&&=&&&495
&&&&&&Left&&&&&&&&&&&&=&&&1800
&&&&&&TabIndex&&&&&&&&=&&&5
&&&&&&Top&&&&&&&&&&&&&=&&&600
&&&&&&Width&&&&&&&&&&&=&&&1215
&&&Begin&VB.PictureBox&P1&
&&&&&&Appearance&&&&&&=&&&0&&'Flat
&&&&&&BackColor&&&&&&&=&&&&H&
&&&&&&ForeColor&&&&&&&=&&&&H&
&&&&&&Height&&&&&&&&&&=&&&255
&&&&&&Left&&&&&&&&&&&&=&&&240
&&&&&&ScaleHeight&&&&&=&&&225
&&&&&&ScaleWidth&&&&&&=&&&6585
&&&&&&TabIndex&&&&&&&&=&&&4
&&&&&&Top&&&&&&&&&&&&&=&&&240
&&&&&&Width&&&&&&&&&&&=&&&6615
&&&Begin&VB.PictureBox&p0&
&&&&&&Appearance&&&&&&=&&&0&&'Flat
&&&&&&BackColor&&&&&&&=&&&&H&
&&&&&&ForeColor&&&&&&&=&&&&H&
&&&&&&Height&&&&&&&&&&=&&&255
&&&&&&Left&&&&&&&&&&&&=&&&240
&&&&&&ScaleHeight&&&&&=&&&225
&&&&&&ScaleWidth&&&&&&=&&&6585
&&&&&&TabIndex&&&&&&&&=&&&3
&&&&&&Top&&&&&&&&&&&&&=&&&240
&&&&&&Width&&&&&&&&&&&=&&&6615
&&&Begin&VB.Frame&Frame1&
&&&&&&Height&&&&&&&&&&=&&&6255
&&&&&&Left&&&&&&&&&&&&=&&&360
&&&&&&TabIndex&&&&&&&&=&&&1
&&&&&&Top&&&&&&&&&&&&&=&&&1200
&&&&&&Width&&&&&&&&&&&=&&&6255
&&&&&&Begin&VB.PictureBox&nPic&
&&&&&&&&&BackColor&&&&&&&=&&&&H008080FF&
&&&&&&&&&BorderStyle&&&&&=&&&0&&'None
&&&&&&&&&Height&&&&&&&&&&=&&&615
&&&&&&&&&Index&&&&&&&&&&&=&&&0
&&&&&&&&&Left&&&&&&&&&&&&=&&&360
&&&&&&&&&ScaleHeight&&&&&=&&&615
&&&&&&&&&ScaleWidth&&&&&&=&&&105
&&&&&&&&&TabIndex&&&&&&&&=&&&2
&&&&&&&&&Top&&&&&&&&&&&&&=&&&240
&&&&&&&&&Visible&&&&&&&&&=&&&0&&&'False
&&&&&&&&&Width&&&&&&&&&&&=&&&100
&&&Begin&mandButton&kaishi&
&&&&&&Caption&&&&&&&&&=&&&&开始游戏&
&&&&&&Height&&&&&&&&&&=&&&495
&&&&&&Left&&&&&&&&&&&&=&&&240
&&&&&&TabIndex&&&&&&&&=&&&0
&&&&&&Top&&&&&&&&&&&&&=&&&600
&&&&&&Width&&&&&&&&&&&=&&&1335
&&&Begin&VB.Label&Label1&
&&&&&&Caption&&&&&&&&&=&&&&难度等级&
&&&&&&Height&&&&&&&&&&=&&&255
&&&&&&Left&&&&&&&&&&&&=&&&3720
&&&&&&TabIndex&&&&&&&&=&&&7
&&&&&&Top&&&&&&&&&&&&&=&&&720
&&&&&&Width&&&&&&&&&&&=&&&855
Attribute&VB_Name&=&&Form1&
Attribute&VB_GlobalNameSpace&=&False
Attribute&VB_Creatable&=&False
Attribute&VB_PredeclaredId&=&True
Attribute&VB_Exposed&=&False
Dim&tmp()&As&Integer&'假设有10种类别的图片,本数组用以记录每组图片加载的次数
Dim&pic(10)&As&ColorConstants
Dim&tCnt&As&Integer
Dim&Fhit&As&ColorConstants
Dim&FhitIndex&As&Long
Private&Sub&Command1_Click()
Private&Sub&jieshu_Click()
&&&&Timer1.Enabled&=&False
&&&&dengji.Enabled&=&True
&&&&P1.Width&=&p0.Width
&&&&Jieshu.Enabled&=&False
&&&&kaishi.Enabled&=&True
Private&Sub&Form_Initialize()
&&&&Dim&i&As&Integer
&&&&For&i&=&1&To&10
&&&&&&&&pic(i)&=&RGB(Int(Rnd&*&255),&Int(Rnd&*&255),&Int(Rnd&*&255))
&&&&Next&i
&&&&dengji.Clear
&&&&For&i&=&3&To&1&Step&-1
&&&&&&&&dengji.AddItem&i&&&&分钟&
&&&&Next&i
&&&&dengji.ListIndex&=&0
&&&&Timer1.Interval&=&1000
&&&&Timer1.Enabled&=&False
&&&&Jieshu.Enabled&=&False
Private&Sub&Form_Load()
&&&&'IntPic
'初始化控件数组
Private&Sub&IntPic()
&&&&Dim&i&As&Integer
&&&&ReDim&tmp(10)&As&Integer
&&&&nPic(0).Move&200,&200,&500,&500
&&&&nPic(0).Visible&=&False
&&&&For&i&=&1&To&100
&&&&&&&&If&ExistPic(nPic(i))&Then&Unload&nPic(i)
&&&&&&&&Load&nPic(i)
&&&&&&&&nPic(i).Visible&=&True
&&&&&&&&nPic(i).Width&=&500
&&&&&&&&nPic(i).BackColor&=&pic(LoadPic)
&&&&&&&&nPic(i).Top&=&(i&Mod&10)&*&(500&+&100)&+&200
&&&&&&&&nPic(i).Left&=&((i&-&1)&\&10)&*&(500&+&100)&+&200
&&&&&&&&nPic(i).Visible&=&True
&&&&Next&i
'判断控件是否存在
Function&ExistPic(obj&As&PictureBox)&As&Boolean
&&&&On&Error&GoTo&errobj
&&&&obj.Move&obj.Left
&&&&ExistPic&=&True
&&&&Exit&Function
&&&&ExistPic&=&False
End&Function
'随机赋予控件颜色,可更改为指定的图片
Private&Function&LoadPic()
&&&&Dim&ntmp&As&Integer
&&&&&&&&ntmp&=&Int(Rnd&*&10)&+&1
&&&&&&&&If&tmp(ntmp)&$<$10&Then
&&&&&&&&&&&&LoadPic&=&ntmp
&&&&&&&&&&&&tmp(ntmp)&=&tmp(ntmp)&+&1
&&&&&&&&&&&&Exit&Do
&&&&&&&&End&If
End&Function
Private&Sub&kaishi_Click()
&&&&tCnt&=&0
&&&&IntPic
&&&&Timer1.Enabled&=&True
&&&&dengji.Enabled&=&False
&&&&kaishi.Enabled&=&False
&&&&Jieshu.Enabled&=&True
Private&Sub&nPic_Click(Index&As&Integer)
&&&&If&Fhit&=&0&Then
&&&&&&&&Fhit&=&nPic(Index).BackColor
&&&&&&&&FhitIndex&=&Index
&&&&&&&&nPic(Index).BorderStyle&=&1
&&&&ElseIf&Fhit&=&nPic(Index).BackColor&And&Index&$$FhitIndex&Then
&&&&&&&&nPic(FhitIndex).Visible&=&False
&&&&&&&&nPic(Index).Visible&=&False
&&&&&&&&FhitIndex&=&0
&&&&&&&&Fhit&=&0
&&&&&&&&nPic(Index).BorderStyle&=&1
&&&&&&&&nPic(FhitIndex).BorderStyle&=&0
&&&&&&&&Fhit&=&nPic(Index).BackColor
&&&&&&&&nPic(FhitIndex).BorderStyle&=&0
&&&&&&&&nPic(Index).BorderStyle&=&1
&&&&&&&&FhitIndex&=&Index
&&&&End&If
&&&&Debug.Print&Fhit
Private&Sub&Timer1_Timer()
&&&&If&tCnt&$>$Val(dengji.Text)&*&60&Then
&&&&&&&&MsgBox&&游戏结束&
&&&&&&&&Timer1.Enabled&=&False
&&&&&&&&Exit&Sub
&&&&End&If
&&&&tCnt&=&tCnt&+&1
&&&&P1.Width&=&p0.Width&*&(1&-&Format((tCnt&/&(Val(dengji.Text)&*&60)),&&0.000&))
&&&&&&&&提问收益:0.00&***豆
给你段代码吧,直接复制粘贴到文本文件,改名为1.frm即可运行(关于连线的判断自己需要加一段算法代码,本程序中没写):
VERSION&5.00
Begin&VB.Form&Form1&
&&&BorderStyle&&&&&=&&&1&&'Fixed&Single
&&&Caption&&&&&&&&&=&&&&Form1&
&&&ClientHeight&&&&=&&&7680
&&&ClientLeft&&&&&&=&&&45
&&&ClientTop&&&&&&&=&&&435
&&&ClientWidth&&&&&=&&&7170
&&&LinkTopic&&&&&&&=&&&&Form1&
&&&MaxButton&&&&&&&=&&&0&&&'False
&&&MinButton&&&&&&&=&&&0&&&'False
&&&ScaleHeight&&&&&=&&&7680
&&&ScaleWidth&&&&&&=&&&7170
&&&StartUpPosition&=&&&3&&'窗口缺省
&&&Begin&VB.Timer&Timer1&
&&&&&&Left&&&&&&&&&&&&=&&&6720
&&&&&&Top&&&&&&&&&&&&&=&&&2880
&&&Begin&boBox&dengji&
&&&&&&Height&&&&&&&&&&=&&&300
&&&&&&Left&&&&&&&&&&&&=&&&4680
&&&&&&Style&&&&&&&&&&&=&&&2&&'Dropdown&List
&&&&&&TabIndex&&&&&&&&=&&&6
&&&&&&Top&&&&&&&&&&&&&=&&&720
&&&&&&Width&&&&&&&&&&&=&&&1935
&&&Begin&mandButton&Jieshu&
&&&&&&Caption&&&&&&&&&=&&&&结束游戏&
&&&&&&Height&&&&&&&&&&=&&&495
&&&&&&Left&&&&&&&&&&&&=&&&1800
&&&&&&TabIndex&&&&&&&&=&&&5
&&&&&&Top&&&&&&&&&&&&&=&&&600
&&&&&&Width&&&&&&&&&&&=&&&1215
&&&Begin&VB.PictureBox&P1&
&&&&&&Appearance&&&&&&=&&&0&&'Flat
&&&&&&BackColor&&&&&&&=&&&&H&
&&&&&&ForeColor&&&&&&&=&&&&H&
&&&&&&Height&&&&&&&&&&=&&&255
&&&&&&Left&&&&&&&&&&&&=&&&240
&&&&&&ScaleHeight&&&&&=&&&225
&&&&&&ScaleWidth&&&&&&=&&&6585
&&&&&&TabIndex&&&&&&&&=&&&4
&&&&&&Top&&&&&&&&&&&&&=&&&240
&&&&&&Width&&&&&&&&&&&=&&&6615
&&&Begin&VB.PictureBox&p0&
&&&&&&Appearance&&&&&&=&&&0&&'Flat
&&&&&&BackColor&&&&&&&=&&&&H&
&&&&&&ForeColor&&&&&&&=&&&&H&
&&&&&&Height&&&&&&&&&&=&&&255
&&&&&&Left&&&&&&&&&&&&=&&&240
&&&&&&ScaleHeight&&&&&=&&&225
&&&&&&ScaleWidth&&&&&&=&&&6585
&&&&&&TabIndex&&&&&&&&=&&&3
&&&&&&Top&&&&&&&&&&&&&=&&&240
&&&&&&Width&&&&&&&&&&&=&&&6615
&&&Begin&VB.Frame&Frame1&
&&&&&&Height&&&&&&&&&&=&&&6255
&&&&&&Left&&&&&&&&&&&&=&&&360
&&&&&&TabIndex&&&&&&&&=&&&1
&&&&&&Top&&&&&&&&&&&&&=&&&1200
&&&&&&Width&&&&&&&&&&&=&&&6255
&&&&&&Begin&VB.PictureBox&nPic&
&&&&&&&&&BackColor&&&&&&&=&&&&H008080FF&
&&&&&&&&&BorderStyle&&&&&=&&&0&&'None
&&&&&&&&&Height&&&&&&&&&&=&&&615
&&&&&&&&&Index&&&&&&&&&&&=&&&0
&&&&&&&&&Left&&&&&&&&&&&&=&&&360
&&&&&&&&&ScaleHeight&&&&&=&&&615
&&&&&&&&&ScaleWidth&&&&&&=&&&105
&&&&&&&&&TabIndex&&&&&&&&=&&&2
&&&&&&&&&Top&&&&&&&&&&&&&=&&&240
&&&&&&&&&Visible&&&&&&&&&=&&&0&&&'False
&&&&&&&&&Width&&&&&&&&&&&=&&&100
&&&Begin&mandButton&kaishi&
&&&&&&Caption&&&&&&&&&=&&&&开始游戏&
&&&&&&Height&&&&&&&&&&=&&&495
&&&&&&Left&&&&&&&&&&&&=&&&240
&&&&&&TabIndex&&&&&&&&=&&&0
&&&&&&Top&&&&&&&&&&&&&=&&&600
&&&&&&Width&&&&&&&&&&&=&&&1335
&&&Begin&VB.Label&Label1&
&&&&&&Caption&&&&&&&&&=&&&&难度等级&
&&&&&&Height&&&&&&&&&&=&&&255
&&&&&&Left&&&&&&&&&&&&=&&&3720
&&&&&&TabIndex&&&&&&&&=&&&7
&&&&&&Top&&&&&&&&&&&&&=&&&720
&&&&&&Width&&&&&&&&&&&=&&&855
Attribute&VB_Name&=&&Form1&
Attribute&VB_GlobalNameSpace&=&False
Attribute&VB_Creatable&=&False
Attribute&VB_PredeclaredId&=&True
Attribute&VB_Exposed&=&False
Dim&tmp()&As&Integer&'假设有10种类别的图片,本数组用以记录每组图片加载的次数
Dim&pic(10)&As&ColorConstants
Dim&tCnt&As&Integer
Dim&Fhit&As&ColorConstants
Dim&FhitIndex&As&Long
Private&Sub&Command1_Click()
Private&Sub&jieshu_Click()
&&&&Timer1.Enabled&=&False
&&&&dengji.Enabled&=&True
&&&&P1.Width&=&p0.Width
&&&&Jieshu.Enabled&=&False
&&&&kaishi.Enabled&=&True
Private&Sub&Form_Initialize()
&&&&Dim&i&As&Integer
&&&&For&i&=&1&To&10
&&&&&&&&pic(i)&=&RGB(Int(Rnd&*&255),&Int(Rnd&*&255),&Int(Rnd&*&255))
&&&&Next&i
&&&&dengji.Clear
&&&&For&i&=&3&To&1&Step&-1
&&&&&&&&dengji.AddItem&i&&&&分钟&
&&&&Next&i
&&&&dengji.ListIndex&=&0
&&&&Timer1.Interval&=&1000
&&&&Timer1.Enabled&=&False
&&&&Jieshu.Enabled&=&False
Private&Sub&Form_Load()
&&&&'IntPic
'初始化控件数组
Private&Sub&IntPic()
&&&&Dim&i&As&Integer
&&&&ReDim&tmp(10)&As&Integer
&&&&nPic(0).Move&200,&200,&500,&500
&&&&nPic(0).Visible&=&False
&&&&For&i&=&1&To&100
&&&&&&&&If&ExistPic(nPic(i))&Then&Unload&nPic(i)
&&&&&&&&Load&nPic(i)
&&&&&&&&nPic(i).Visible&=&True
&&&&&&&&nPic(i).Width&=&500
&&&&&&&&nPic(i).BackColor&=&pic(LoadPic)
&&&&&&&&nPic(i).Top&=&(i&Mod&10)&*&(500&+&100)&+&200
&&&&&&&&nPic(i).Left&=&((i&-&1)&\&10)&*&(500&+&100)&+&200
&&&&&&&&nPic(i).Visible&=&True
&&&&Next&i
'判断控件是否存在
Function&ExistPic(obj&As&PictureBox)&As&Boolean
&&&&On&Error&GoTo&errobj
&&&&obj.Move&obj.Left
&&&&ExistPic&=&True
&&&&Exit&Function
&&&&ExistPic&=&False
End&Function
'随机赋予控件颜色,可更改为指定的图片
Private&Function&LoadPic()
&&&&Dim&ntmp&As&Integer
&&&&&&&&ntmp&=&Int(Rnd&*&10)&+&1
&&&&&&&&If&tmp(ntmp)&$<$10&Then
&&&&&&&&&&&&LoadPic&=&ntmp
&&&&&&&&&&&&tmp(ntmp)&=&tmp(ntmp)&+&1
&&&&&&&&&&&&Exit&Do
&&&&&&&&End&If
End&Function
Private&Sub&kaishi_Click()
&&&&tCnt&=&0
&&&&IntPic
&&&&Timer1.Enabled&=&True
&&&&dengji.Enabled&=&False
&&&&kaishi.Enabled&=&False
&&&&Jieshu.Enabled&=&True
Private&Sub&nPic_Click(Index&As&Integer)
&&&&If&Fhit&=&0&Then
&&&&&&&&Fhit&=&nPic(Index).BackColor
&&&&&&&&FhitIndex&=&Index
&&&&&&&&nPic(Index).BorderStyle&=&1
&&&&ElseIf&Fhit&=&nPic(Index).BackColor&And&Index&$$FhitIndex&Then
&&&&&&&&nPic(FhitIndex).Visible&=&False
&&&&&&&&nPic(Index).Visible&=&False
&&&&&&&&FhitIndex&=&0
&&&&&&&&Fhit&=&0
&&&&&&&&nPic(Index).BorderStyle&=&1
&&&&&&&&nPic(FhitIndex).BorderStyle&=&0
&&&&&&&&Fhit&=&nPic(Index).BackColor
&&&&&&&&nPic(FhitIndex).BorderStyle&=&0
&&&&&&&&nPic(Index).BorderStyle&=&1
&&&&&&&&FhitIndex&=&Index
&&&&End&If
&&&&Debug.Print&Fhit
Private&Sub&Timer1_Timer()
&&&&If&tCnt&$>$Val(dengji.Text)&*&60&Then
&&&&&&&&MsgBox&&游戏结束&
&&&&&&&&Timer1.Enabled&=&False
&&&&&&&&Exit&Sub
&&&&End&If
&&&&tCnt&=&tCnt&+&1
&&&&P1.Width&=&p0.Width&*&(1&-&Format((tCnt&/&(Val(dengji.Text)&*&60)),&&0.000&))
&&&&&&&&提问收益:0.00&***豆
把代码复制到空窗体中按F5运行即可。 Option Explicit Private WithEvents Timer1 As Timer Private WithEvents Label1 As Label Dim GFangXiang As Boolean Dim HWB As Single Dim She() As ShenTi Dim X As Long, Y As Long Dim ZhuangTai(23, 23) As Long Private Type ShenTi && F As Long && X As Long && Y As Long End Type Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Dim C As Long If KeyCode = 27 Then End If KeyCode = 32 Then && If Timer1.Enabled = True Then &&&&& Timer1.Enabled = False &&&&& Label1.Visible = True && Else &&&&& Timer1.Enabled = True &&&&& Label1.Visible = False && End If End If C = UBound(She) If GFangXiang = True Then Exit Sub Select Case KeyCode Case 37 && If She(C).F = 2 Then Exit Sub && She(C).F = 0 && GFangXiang = True Case 38 && If She(C).F = 3 Then Exit Sub && She(C).F = 1 && GFangXiang = True Case 39 && If She(C).F = 0 Then Exit Sub && She(C).F = 2 && GFangXiang = True Case 40 && If She(C).F = 1 Then Exit Sub && She(C).F = 3 && GFangXiang = True End Select End Sub Private Sub Form_Load() Me.AutoRedraw = True Me.BackColor = &HC000& Me.FillColor = 255 Me.FillStyle. = 0 Me.ScaleWidth = 24 Me.ScaleHeight = 24 Me.WindowState = 2 Set Timer1 = Controls.Add(&VB.Timer&, &Timer1&) Set Label1 = Controls.Add(&VB.Label&, &Label1&) Label1.AutoSize = True Label1.BackStyle. = 0 Label1 = &暂停& Label1.ForeColor = RGB(255, 255, 0) Label1.FontSize = 50 ChuShiHua End Sub Private Sub Form_Resize() On Error GoTo 1: With Me && If .WindowState $<$ 1 Then &&&&& .Cls &&&&& .ScaleMode = 3 &&&&& HWB = .ScaleHeight / .ScaleWidth &&&&& .ScaleWidth = 24 &&&&& .ScaleHeight = 24 &&&&& Label1.Move (Me.ScaleWidth - Label1.Width) / 2, (Me.ScaleHeight - Label1.Height) / 2 &&&&& HuaTu &&&&& Me.Line (X, Y)-(X + 1, Y + 1), RGB(255, 255, 0), BF && End If End With 1: End Sub Private Sub Timer1_Timer() Dim C As Long, I As Long On Error GoTo 2: QingChu C = UBound(She) Select Case She(C).F Case 0 && If ZhuangTai(She(C).X - 1, She(C).Y) = 2 Then &&&&& C = C + 1 &&&&& ReDim Preserve She(C) &&&&& She(C).F = She(C - 1).F &&&&& She(C).X = She(C - 1).X - 1 &&&&& She(C).Y = She(C - 1).Y &&&&& ChanShengShiWu &&&&& GoTo 1: && ElseIf ZhuangTai(She(C).X - 1, She(C).Y) = 1 Then &&&&& GoTo 2: && End If Case 1 && If ZhuangTai(She(C).X, She(C).Y - 1) = 2 Then &&&&& C = C + 1 &&&&& ReDim Preserve She(C) &&&&& She(C).F = She(C - 1).F &&&&& She(C).X = She(C - 1).X &&&&& She(C).Y = She(C - 1).Y - 1 &&&&& ChanShengShiWu &&&&& GoTo 1: && ElseIf ZhuangTai(She(C).X, She(C).Y - 1) = 1 Then &&&&& GoTo 2: && End If Case 2 && If ZhuangTai(She(C).X + 1, She(C).Y) = 2 Then &&&&& C = C + 1 &&&&& ReDim Preserve She(C) &&&&& She(C).F = She(C - 1).F &&&&& She(C).X = She(C - 1).X + 1 &&&&& She(C).Y = She(C - 1).Y &&&&& ChanShengShiWu &&&&& GoTo 1: && ElseIf ZhuangTai(She(C).X + 1, She(C).Y) = 1 Then &&&&& GoTo 2: && End If Case 3 && If ZhuangTai(She(C).X, She(C).Y + 1) = 2 Then &&&&& C = C + 1 &&&&& ReDim Preserve She(C) &&&&& She(C).F = She(C - 1).F &&&&& She(C).X = She(C - 1).X &&&&& She(C).Y = She(C - 1).Y + 1 &&&&& ChanShengShiWu &&&&& GoTo 1: && ElseIf ZhuangTai(She(C).X, She(C).Y + 1) = 1 Then &&&&& GoTo 2: && End If End Select ZhuangTai(She(0).X, She(0).Y) = 0 For I = 0 To C && Select Case She(I).F && Case 0 &&&&& She(I).X = She(I).X - 1 && Case 1 &&&&& She(I).Y = She(I).Y - 1 && Case 2 &&&&& She(I).X = She(I).X + 1 && Case 3 &&&&& She(I).Y = She(I).Y + 1 && End Select Next TiaoZheng 1: GFangXiang = False ZhuangTai(She(C).X, She(C).Y) = 1 HuaTu Exit Sub 2: If MsgBox(&游戏结束,点“是”重新开始游戏,点“否”&, vbYesNo, &贪吃蛇&) = vbYes Then && ChuShiHua Else && End End If End Sub Private Sub ChuShiHua() Me.Cls Timer1.Enabled = True Timer1.Interval = 200 Erase ZhuangTai ReDim She(2) She(0).F = 2 She(0).X = 9 She(0).Y = 11 ZhuangTai(9, 11) = 1 She(1).F = 2 She(1).X = 10 She(1).Y = 11 ZhuangTai(10, 11) = 1 She(2).F = 2 She(2).X = 11 She(2).Y = 11 ZhuangTai(11, 11) = 1 HuaTu ChanShengShiWu End Sub Private Sub QingChu() Dim I As Long For I = 0 To UBound(She) && Me.Line (She(I).X, She(I).Y)-(She(I).X + 1, She(I).Y + 1), Me.BackColor, BF Next End Sub Private Sub HuaTu() Dim I As Long For I = 0 To UBound(She) && Me.Circle (She(I).X + 0.5, She(I).Y + 0.5), 0.49, RGB(255, 255, 0), , , HWB Next End Sub Private Sub TiaoZheng() Dim I As Long For I = 0 To UBound(She) - 1 && She(I).F = She(I + 1).F Next End Sub Private Sub ChanShengShiWu() Randomize Timer 1: X = Int(Rnd * 24) Y = Int(Rnd * 24) If ZhuangTai(X, Y) & 0 Then GoTo 1: ZhuangTai(X, Y) = 2 Me.Line (X, Y)-(X + 1, Y + 1), RGB(255, 255, 0), BF End Sub
&&&&&&&&提问收益:0.00&***豆
这段代码吧,按这个写程序你试一下VERSION&5.00Begin&VB.Form&Form1&&&&BorderStyle&&&&&=&&&1&&'Fixed&Single&&&Caption&&&&&&&&&=&&&&Form1&&&&ClientHeight&&&&=&&&7680&&&ClientLeft&&&&&&=&&&45&&&ClientTop&&&&&&&=&&&435&&&ClientWidth&&&&&=&&&7170&&&LinkTopic&&&&&&&=&&&&Form1&&&&MaxButton&&&&&&&=&&&0&&&'False&&&MinButton&&&&&&&=&&&0&&&'False&&&ScaleHeight&&&&&=&&&7680&&&ScaleWidth&&&&&&=&&&7170&&&StartUpPosition&=&&&3&&'窗口缺省&&&Begin&VB.Timer&Timer1&&&&&&&Left&&&&&&&&&&&&=&&&6720&&&&&&Top&&&&&&&&&&&&&=&&&2880&&&End&&&Begin&boBox&dengji&&&&&&&Height&&&&&&&&&&=&&&300&&&&&&Left&&&&&&&&&&&&=&&&4680&&&&&&Style&&&&&&&&&&&=&&&2&&'Dropdown&List&&&&&&TabIndex&&&&&&&&=&&&6&&&&&&Top&&&&&&&&&&&&&=&&&720&&&&&&Width&&&&&&&&&&&=&&&1935&&&End&&&Begin&mandButton&Jieshu&&&&&&&Caption&&&&&&&&&=&&&&结束游戏&&&&&&&Height&&&&&&&&&&=&&&495&&&&&&Left&&&&&&&&&&&&=&&&1800&&&&&&TabIndex&&&&&&&&=&&&5&&&&&&Top&&&&&&&&&&&&&=&&&600&&&&&&Width&&&&&&&&&&&=&&&1215&&&End&&&Begin&VB.PictureBox&P1&&&&&&&Appearance&&&&&&=&&&0&&'Flat&&&&&&BackColor&&&&&&&=&&&&H&&&&&&&ForeColor&&&&&&&=&&&&H&&&&&&&Height&&&&&&&&&&=&&&255&&&&&&Left&&&&&&&&&&&&=&&&240&&&&&&ScaleHeight&&&&&=&&&225&&&&&&ScaleWidth&&&&&&=&&&6585&&&&&&TabIndex&&&&&&&&=&&&4&&&&&&Top&&&&&&&&&&&&&=&&&240&&&&&&Width&&&&&&&&&&&=&&&6615&&&End&&&Begin&VB.PictureBox&p0&&&&&&&Appearance&&&&&&=&&&0&&'Flat&&&&&&BackColor&&&&&&&=&&&&H&&&&&&&ForeColor&&&&&&&=&&&&H&&&&&&&Height&&&&&&&&&&=&&&255&&&&&&Left&&&&&&&&&&&&=&&&240&&&&&&ScaleHeight&&&&&=&&&225&&&&&&ScaleWidth&&&&&&=&&&6585&&&&&&TabIndex&&&&&&&&=&&&3&&&&&&Top&&&&&&&&&&&&&=&&&240&&&&&&Width&&&&&&&&&&&=&&&6615&&&End&&&Begin&VB.Frame&Frame1&&&&&&&Height&&&&&&&&&&=&&&6255&&&&&&Left&&&&&&&&&&&&=&&&360&&&&&&TabIndex&&&&&&&&=&&&1&&&&&&Top&&&&&&&&&&&&&=&&&1200&&&&&&Width&&&&&&&&&&&=&&&6255&&&&&&Begin&VB.PictureBox&nPic&&&&&&&&&&BackColor&&&&&&&=&&&&H008080FF&&&&&&&&&&BorderStyle&&&&&=&&&0&&'None&&&&&&&&&Height&&&&&&&&&&=&&&615&&&&&&&&&Index&&&&&&&&&&&=&&&0&&&&&&&&&Left&&&&&&&&&&&&=&&&360&&&&&&&&&ScaleHeight&&&&&=&&&615&&&&&&&&&ScaleWidth&&&&&&=&&&105&&&&&&&&&TabIndex&&&&&&&&=&&&2&&&&&&&&&Top&&&&&&&&&&&&&=&&&240&&&&&&&&&Visible&&&&&&&&&=&&&0&&&'False&&&&&&&&&Width&&&&&&&&&&&=&&&100&&&&&&End&&&End&&&Begin&mandButton&kaishi&&&&&&&Caption&&&&&&&&&=&&&&开始游戏&&&&&&&Height&&&&&&&&&&=&&&495&&&&&&Left&&&&&&&&&&&&=&&&240&&&&&&TabIndex&&&&&&&&=&&&0&&&&&&Top&&&&&&&&&&&&&=&&&600&&&&&&Width&&&&&&&&&&&=&&&1335&&&End&&&Begin&VB.Label&Label1&&&&&&&Caption&&&&&&&&&=&&&&难度等级&&&&&&&Height&&&&&&&&&&=&&&255&&&&&&Left&&&&&&&&&&&&=&&&3720&&&&&&TabIndex&&&&&&&&=&&&7&&&&&&Top&&&&&&&&&&&&&=&&&720&&&&&&Width&&&&&&&&&&&=&&&855&&&EndEndAttribute&VB_Name&=&&Form1&Attribute&VB_GlobalNameSpace&=&FalseAttribute&VB_Creatable&=&FalseAttribute&VB_PredeclaredId&=&TrueAttribute&VB_Exposed&=&FalseDim&tmp()&As&Integer&'假设有10种类别的图片,本数组用以记录每组图片加载的次数Dim&pic(10)&As&ColorConstantsDim&tCnt&As&IntegerDim&Fhit&As&ColorConstantsDim&FhitIndex&As&LongPrivate&Sub&Command1_Click()&&&&End&SubPrivate&Sub&jieshu_Click()&&&&Timer1.Enabled&=&False&&&&dengji.Enabled&=&True&&&&P1.Width&=&p0.Width&&&&Jieshu.Enabled&=&False&&&&kaishi.Enabled&=&TrueEnd&SubPrivate&Sub&Form_Initialize()&&&&Dim&i&As&Integer&&&&For&i&=&1&To&10&&&&&&&&pic(i)&=&RGB(Int(Rnd&*&255),&Int(Rnd&*&255),&Int(Rnd&*&255))&&&&Next&i&&&&dengji.Clear&&&&For&i&=&3&To&1&Step&-1&&&&&&&&dengji.AddItem&i&&&&分钟&&&&&Next&i&&&&dengji.ListIndex&=&0&&&&Timer1.Interval&=&1000&&&&Timer1.Enabled&=&False&&&&Jieshu.Enabled&=&FalseEnd&SubPrivate&Sub&Form_Load()&&&&'IntPicEnd&Sub'初始化控件数组Private&Sub&IntPic()&&&&Dim&i&As&Integer&&&&ReDim&tmp(10)&As&Integer&&&&nPic(0).Move&200,&200,&500,&500&&&&nPic(0).Visible&=&False&&&&For&i&=&1&To&100&&&&&&&&If&ExistPic(nPic(i))&Then&Unload&nPic(i)&&&&&&&&Load&nPic(i)&&&&&&&&nPic(i).Visible&=&True&&&&&&&&nPic(i).Width&=&500&&&&&&&&nPic(i).BackColor&=&pic(LoadPic)&&&&&&&&nPic(i).Top&=&(i&Mod&10)&*&(500&+&100)&+&200&&&&&&&&nPic(i).Left&=&((i&-&1)&\&10)&*&(500&+&100)&+&200&&&&&&&&nPic(i).Visible&=&True&&&&Next&iEnd&Sub'判断控件是否存在Function&ExistPic(obj&As&PictureBox)&As&Boolean&&&&On&Error&GoTo&errobj&&&&obj.Move&obj.Left&&&&ExistPic&=&True&&&&Exit&Functionerrobj:&&&&ExistPic&=&FalseEnd&Function'随机赋予控件颜色,可更改为指定的图片Private&Function&LoadPic()&&&&Dim&ntmp&As&Integer&&&&Do&&&&&&&&ntmp&=&Int(Rnd&*&10)&+&1&&&&&&&&If&tmp(ntmp)&$$FhitIndex&Then
&&&&&&&&nPic(FhitIndex).Visible&=&False
&&&&&&&&nPic(Index).Visible&=&False
&&&&&&&&FhitIndex&=&0
&&&&&&&&Fhit&=&0
&&&&&&&&nPic(Index).BorderStyle&=&1
&&&&&&&&nPic(FhitIndex).BorderStyle&=&0
&&&&&&&&Fhit&=&nPic(Index).BackColor
&&&&&&&&nPic(FhitIndex).BorderStyle&=&0
&&&&&&&&nPic(Index).BorderStyle&=&1
&&&&&&&&FhitIndex&=&Index
&&&&End&If
&&&&Debug.Print&Fhit
Private&Sub&Timer1_Timer()
&&&&If&tCnt&&$$Val(dengji.Text)&*&60&Then
&&&&&&&&MsgBox&&游戏结束&
&&&&&&&&Timer1.Enabled&=&False
&&&&&&&&Exit&Sub
&&&&End&If
&&&&tCnt&=&tCnt&+&1
&&&&P1.Width&=&p0.Width&*&(1&-&Format((tCnt&/&(Val(dengji.Text)&*&60)),&&0.000&))
您可能感兴趣的试题
1我对汽车坐垫不是很懂,希望知道的人告诉我一声2特征γ射线的意义用途?3求圆周率的数值4今天是星期三,那过2的2007次方天后是星期几,用二次项定理解答
我有更好的***
请先输入下方的验证码查看最佳***
图形验证:
验证码提交中……
找***会员
享三项特权
找***会员
享三项特权
找***会员
享三项特权
选择支付方式:
支付宝付款
郑重提醒:支付后,系统自动为您完成注册
请使用微信扫码支付(元)
支付后,系统自动为您完成注册
遇到问题请联系在线***QQ:
请您不要关闭此页面,支付完成后点击支付完成按钮
遇到问题请联系在线***QQ:
恭喜您!升级VIP会员成功
常用邮箱:
用于找回密码
确认密码:

参考资料

 

随机推荐