VB拼图游戏源代码.docx
- 文档编号:12546288
- 上传时间:2023-06-06
- 格式:DOCX
- 页数:21
- 大小:15.53KB
VB拼图游戏源代码.docx
《VB拼图游戏源代码.docx》由会员分享,可在线阅读,更多相关《VB拼图游戏源代码.docx(21页珍藏版)》请在冰点文库上搜索。
VB拼图游戏源代码
DimaAsInteger,bAsInteger,cAsInteger,dAsInteger,eAsString,jbAsInteger
PrivateSubEnd_Click()
End
EndSub
PrivateSubForm_Load()
DimiAsInteger,aAsInteger,bAsInteger
Fori=0To7
Image1(i).Picture=LoadPicture("C:
\Users\Administrator\Desktop\图片\"&(i+1)&".jpg")
Label1(i).FontSize=110
Nexti
Randomize
EndSub
PrivateSubImage1_Click(IndexAsInteger)
IfIndex=8Then
IfImage1(5).Picture=FalseThen
Image2.Picture=Image1(8).Picture
Image1(8).Picture=Image1(5).Picture
Image1(5).Picture=Image2.Picture
e=Label1(8).Caption
Label1(8).Caption=Label1(5).Caption
Label1(5)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(7).Picture=FalseThen
Image2.Picture=Image1(8).Picture
Image1(8).Picture=Image1(7).Picture
Image1(7).Picture=Image2.Picture
e=Label1(8).Caption
Label1(8).Caption=Label1(7).Caption
Label1(7)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
IfIndex=6Then
IfImage1(3).Picture=FalseThen
Image2.Picture=Image1(6).Picture
Image1(6).Picture=Image1(3).Picture
Image1(3).Picture=Image2.Picture
e=Label1(6).Caption
Label1(6).Caption=Label1(3).Caption
Label1(3)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(7).Picture=FalseThen
Image2.Picture=Image1(6).Picture
Image1(6).Picture=Image1(7).Picture
Image1(7).Picture=Image2.Picture
e=Label1(6).Caption
Label1(6).Caption=Label1(7).Caption
Label1(7)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
IfIndex=0Then
IfImage1(3).Picture=FalseThen
Image2.Picture=Image1(0).Picture
Image1(0).Picture=Image1(3).Picture
Image1(3).Picture=Image2.Picture
e=Label1(0).Caption
Label1(0).Caption=Label1(3).Caption
Label1(3)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1
(1).Picture=FalseThen
Image2.Picture=Image1(0).Picture
Image1(0).Picture=Image1
(1).Picture
Image1
(1).Picture=Image2.Picture
e=Label1(0).Caption
Label1(0).Caption=Label1
(1).Caption
Label1
(1)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
IfIndex=2Then
IfImage1(5).Picture=FalseThen
Image2.Picture=Image1
(2).Picture
Image1
(2).Picture=Image1(5).Picture
Image1(5).Picture=Image2.Picture
e=Label1
(2).Caption
Label1
(2).Caption=Label1(5).Caption
Label1(5)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1
(1).Picture=FalseThen
Image2.Picture=Image1
(2).Picture
Image1
(2).Picture=Image1
(1).Picture
Image1
(1).Picture=Image2.Picture
e=Label1
(2).Caption
Label1
(2).Caption=Label1
(1).Caption
Label1
(1)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
IfIndex=1Then
IfImage1(0).Picture=FalseThen
Image2.Picture=Image1
(1).Picture
Image1
(1).Picture=Image1(0).Picture
Image1(0).Picture=Image2.Picture
e=Label1
(1).Caption
Label1
(1).Caption=Label1(0).Caption
Label1(0)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1
(2).Picture=FalseThen
Image2.Picture=Image1
(1).Picture
Image1
(1).Picture=Image1
(2).Picture
Image1
(2).Picture=Image2.Picture
e=Label1
(1).Caption
Label1
(1).Caption=Label1
(2).Caption
Label1
(2)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(4).Picture=FalseThen
Image2.Picture=Image1
(1).Picture
Image1
(1).Picture=Image1(4).Picture
Image1(4).Picture=Image2.Picture
e=Label1
(1).Caption
Label1
(1).Caption=Label1(4).Caption
Label1(4)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
EndIf
IfIndex=3Then
IfImage1(0).Picture=FalseThen
Image2.Picture=Image1(3).Picture
Image1(3).Picture=Image1(0).Picture
Image1(0).Picture=Image2.Picture
e=Label1(3).Caption
Label1(3).Caption=Label1(0).Caption
Label1(0)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(6).Picture=FalseThen
Image2.Picture=Image1(3).Picture
Image1(3).Picture=Image1(6).Picture
Image1(6).Picture=Image2.Picture
e=Label1(3).Caption
Label1(3).Caption=Label1(6).Caption
Label1(6)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(4).Picture=FalseThen
Image2.Picture=Image1(3).Picture
Image1(3).Picture=Image1(4).Picture
Image1(4).Picture=Image2.Picture
e=Label1(3).Caption
Label1(3).Caption=Label1(4).Caption
Label1(4)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
EndIf
IfIndex=7Then
IfImage1(8).Picture=FalseThen
Image2.Picture=Image1(7).Picture
Image1(7).Picture=Image1(8).Picture
Image1(8).Picture=Image2.Picture
e=Label1(7).Caption
Label1(7).Caption=Label1(8).Caption
Label1(8)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(6).Picture=FalseThen
Image2.Picture=Image1(7).Picture
Image1(7).Picture=Image1(6).Picture
Image1(6).Picture=Image2.Picture
e=Label1(7).Caption
Label1(7).Caption=Label1(6).Caption
Label1(6)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(4).Picture=FalseThen
Image2.Picture=Image1(7).Picture
Image1(7).Picture=Image1(4).Picture
Image1(4).Picture=Image2.Picture
e=Label1(7).Caption
Label1(7).Caption=Label1(4).Caption
Label1(4)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
EndIf
IfIndex=5Then
IfImage1(8).Picture=FalseThen
Image2.Picture=Image1(5).Picture
Image1(5).Picture=Image1(8).Picture
Image1(8).Picture=Image2.Picture
e=Label1(5).Caption
Label1(5).Caption=Label1(8).Caption
Label1(8)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1
(2).Picture=FalseThen
Image2.Picture=Image1(5).Picture
Image1(5).Picture=Image1
(2).Picture
Image1
(2).Picture=Image2.Picture
e=Label1(5).Caption
Label1(5).Caption=Label1
(2).Caption
Label1
(2)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(4).Picture=FalseThen
Image2.Picture=Image1(5).Picture
Image1(5).Picture=Image1(4).Picture
Image1(4).Picture=Image2.Picture
e=Label1(5).Caption
Label1(5).Caption=Label1(4).Caption
Label1(4)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
EndIf
IfIndex=4Then
IfImage1
(1).Picture=FalseThen
Image2.Picture=Image1(4).Picture
Image1(4).Picture=Image1
(1).Picture
Image1
(1).Picture=Image2.Picture
e=Label1(4).Caption
Label1(4).Caption=Label1
(1).Caption
Label1
(1)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(3).Picture=FalseThen
Image2.Picture=Image1(4).Picture
Image1(4).Picture=Image1(3).Picture
Image1(3).Picture=Image2.Picture
e=Label1(4).Caption
Label1(4).Caption=Label1(3).Caption
Label1(3)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(5).Picture=FalseThen
Image2.Picture=Image1(4).Picture
Image1(4).Picture=Image1(5).Picture
Image1(5).Picture=Image2.Picture
e=Label1(4).Caption
Label1(4).Caption=Label1(5).Caption
Label1(5)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
Else
IfImage1(3).Picture=FalseThen
Image2.Picture=Image1(4).Picture
Image1(4).Picture=Image1(7).Picture
Image1(7).Picture=Image2.Picture
e=Label1(4).Caption
Label1(4).Caption=Label1(7).Caption
Label1(7)=e
Text3.Text=Val(Text3.Text)+1
Timer2.Enabled=True
EndIf
EndIf
EndIf
EndIf
EndIf
EndSub
PrivateSubsj_Click()
Ifc=0Then
c=30
EndIf
Timer1.Enabled=True
EndSub
PrivateSubstop_Click()
Timer1.Enabled=False
EndSub
PrivateSubTimer1_Timer()
IfImage1(8).Picture=FalseThen
a=Format(Rnd*1,0)
Ifa=1Then
Image2.Picture=Image1(8).Picture
Image1(8).Picture=Image1(5).Picture
Image1(5).Picture=Image2.Picture
e=Label1(8).Caption
Label1(8).Caption=Label1(5).Caption
Label1(5)=e
Else
Image2.Picture=Image1(8).Picture
Image1(8).Picture=Image1(7).Picture
Image1(7).Picture=Image2.Picture
e=Label1(8).Caption
Label1(8).Caption=Label1(7).Caption
Label1(7)=e
EndIf
EndIf
IfImage1(6).Picture=FalseThen
a=Format(Rnd*1,0)
Ifa=1Then
Image2.Picture=Image1(6).Picture
Image1(6).Picture=Image1(3).Picture
Image1(3).Picture=Image2.Picture
e=Label1(6).Caption
Label1(6).Caption=Label1(3).Caption
Label1(3)=e
Else
Image2.Picture=Image1(6).Picture
Image1(6).Picture=Image1(7).Picture
Image1(7).Picture=Image2.Picture
e=Label1(6).Caption
Label1(6).Caption=Label1(7).Caption
Label1(7)=e
EndIf
EndIf
IfImage1(0).Picture=FalseThen
a=Format(Rnd*1,0)
Ifa=1Then
Image2.Picture=Image1(0).Picture
Image1(0).Picture=Image1(3).Picture
Image1(3).Picture=Image2.Picture
e=Label1(0).Caption
Label1(0).Caption=Label1(3).Caption
Label1(3)=e
Else
Image2.Picture=Image1(0).Picture
Image1(0).Picture=Image1
(1).Picture
Image1
(1).Picture=Image2.Picture
e=Label1(0).Caption
Label1(0).Caption=Label1
(1).Caption
Label1
(1)=e
EndIf
EndIf
IfImage1
(2).Picture=FalseThen
a=Format(Rnd*1,0)
Ifa=1Then
Image2.Picture=Image1
(2).Picture
Image1
(2).Picture=Image1(5).Picture
Image1(5).Picture=Image2.Picture
e=Label1
(2).Caption
Label1
(2).Caption=Label1(5).Caption
Label1(5)=e
Else
Image2.Picture=Image1
(2).Picture
Image1
(2).Picture=Image1
(1).Picture
Image1
(1).Picture=Image2.Picture
e=La
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- VB 拼图游戏 源代码