Rem 窗体创建三个单选框按钮,Option1、Option2、Option3。
小游戏是一个较模糊的概念,它是相对于体积庞大的单机游戏及网络游戏而言的,泛指所有体积较小、玩法简单的游戏,通常这类游戏以休闲益智类为主,有单机版有网页版,在网页上嵌入的多为FLASH格式。
当下小游戏主要是指在线玩的flash版本游戏,统称小游戏,其实小游戏还包含单机游戏,小型游戏机等。一般游戏大小小于10m的游戏都统称为小游戏,一些街机类小游戏。因其游戏安装简便,耐玩性强,无依赖性而广受白领及小朋友的喜爱。
小游戏”这个词的型含义其实很简单,它不是一些大的游戏,不必花费更多的时间和精力。
小游戏是原始的游戏娱乐方式,小游戏本身是为了叫人们在工作,学习后的一种娱乐、休闲的一种方式,不是为了叫玩家为之花费金钱、花费精力,更不是叫玩家为他痴迷。
小游戏也可以理解为“Flash游戏”,是以SWF为后缀的游戏的总称.这些游戏是通过Flash软件和 Flash 编程语言 Flash ActionScript 制作而成。
由于Flash是矢量软件,所以小游戏放大后几乎不影响画面效果。Flash小游戏是一种新兴起的游戏形式,以游戏简单, *** 作方便,绿色,无需安装,文件体积小等优点渐渐被广大网友喜爱。
猜数字建一个文本文档,输入以下代码,后缀改为.frm用vb打开就可以了
以下是程序源码:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "猜数游戏"
ClientHeight= 3900
ClientLeft = 45
ClientTop = 435
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3900
ScaleWidth = 4680
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "重新开始"
Height = 615
Left= 2640
TabIndex= 2
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 615
Left= 840
TabIndex= 1
Top = 2760
Width = 1095
End
Begin VB.TextBox Text1
Height = 375
Left= 1200
TabIndex= 0
Top = 2040
Width = 2055
End
Begin VB.Label Label9
Caption = "戏"
BeginProperty Font
Name= "宋体"
Size= 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000080FF&
Height = 615
Left= 3720
TabIndex= 11
Top = 240
Width = 615
End
Begin VB.Label Label8
Caption = "游"
BeginProperty Font
Name= "宋体"
Size= 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808080&
Height = 615
Left= 3240
TabIndex= 10
Top = 240
Width = 615
End
Begin VB.Label Label7
Caption = "数"
BeginProperty Font
Name= "宋体"
Size= 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 495
Left= 2760
TabIndex= 9
Top = 240
Width = 615
End
Begin VB.Label Label6
Caption = "猜"
BeginProperty Font
Name= "宋体"
Size= 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 495
Left= 2280
TabIndex= 8
Top = 240
Width = 735
End
Begin VB.Label Label5
Caption = "入"
BeginProperty Font
Name= "宋体"
Size= 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 615
Left= 1800
TabIndex= 7
Top = 240
Width = 855
End
Begin VB.Label Label4
Caption = "进"
BeginProperty Font
Name= "宋体"
Size= 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 735
Left= 1320
TabIndex= 6
Top = 240
Width = 735
End
Begin VB.Label Label3
Caption = "迎"
BeginProperty Font
Name= "宋体"
Size= 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF00&
Height = 735
Left= 840
TabIndex= 5
Top = 240
Width = 735
End
Begin VB.Label Label2
Caption = "欢"
BeginProperty Font
Name= "宋体"
Size= 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 615
Left= 360
TabIndex= 4
Top = 240
Width = 495
End
Begin VB.Label Label1
Caption = "我这儿有1~10的整数,你猜猜看他是多少......"
Height = 375
Left= 480
TabIndex= 3
Top = 1320
Width = 3855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim x As Integer, y As Integer, z As Integer
Dim cishu As Integer
Private Sub Command1_Click()
If cishu = 3 Then MsgBox "已经猜3次了,这个数是" &x: Exit Sub
y = Val(Text1.Text)
If Text1.Text = "" Or Not IsNumeric(Text1.Text) Then
MsgBox "输入有误!请重新输入数字", 48
Text1.Text = ""
Text1.SetFocus
Exit Sub
End If
cishu = cishu + 1
Select Case x - y
Case Is <0
z = MsgBox("你猜数大了,请重猜。注意:你只有三次机会", 48 + 1)
Text1.Text = ""
Text1.SetFocus
Case Is >0
z = MsgBox("你猜数小了,请重猜。注意:你只有三次机会", 48 + 1)
Text1.Text = ""
Text1.SetFocus
Case Else
z = MsgBox("恭喜你猜中了!", 1)
End Select
End Sub
Private Sub Command2_Click()
cishu = 0
Randomize Timer
x = Int((Rnd * 10) + 1)
End Sub
Private Sub Form_Load()
cishu = 0
Randomize Timer
x = Int((Rnd * 10) + 1)
End Sub
代码结束
http://hi.baidu.com/卓7358/
欢迎来我空间
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)