vb小游戏源代码

2024-12-12 09:39:47
推荐回答(3个)
回答1:

Rem 窗体创建三个单选框按钮,Option1、Option2、Option3。

小游戏是一个较模糊的概念,它是相对于体积庞大的单机游戏及网络游戏而言的,泛指所有体积较小、玩法简单的游戏,通常这类游戏以休闲益智类为主,有单机版有网页版,在网页上嵌入的多为FLASH格式。

当下小游戏主要是指在线玩的flash版本游戏,统称小游戏,其实小游戏还包含单机游戏,小型游戏机等。一般游戏大小小于10m的游戏都统称为小游戏,一些街机类小游戏。因其游戏安装简便,耐玩性强,无依赖性而广受白领及小朋友的喜爱。

小游戏”这个词的型含义其实很简单,它不是一些大的游戏,不必花费更多的时间和精力。

小游戏是原始的游戏娱乐方式,小游戏本身是为了叫人们在工作,学习后的一种娱乐、休闲的一种方式,不是为了叫玩家为之花费金钱、花费精力,更不是叫玩家为他痴迷。

小游戏也可以理解为“Flash游戏”,是以SWF为后缀的游戏的总称.这些游戏是通过Flash软件和 Flash 编程语言 Flash ActionScript 制作而成。

由于Flash是矢量软件,所以小游戏放大后几乎不影响画面效果。Flash小游戏是一种新兴起的游戏形式,以游戏简单,操作方便,绿色,无需安装,文件体积小等优点渐渐被广大网友喜爱。

回答2:

Rem 窗体创建三个单选框按钮,Option1、Option2、Option3

Private Sub Form_Activate()
Option1.Caption = "石头"
Option2.Caption = "剪刀"
Option3.Caption = "布"
Option1.Value = False
Option2.Value = False
Option3.Value = False
End Sub

Private Sub Option1_Click()
Randomize
Select Case Int(3 * Rnd)
Case 0: MsgBox "对方也出石头!继续!"
Case 1: MsgBox "哈哈!你赢了!对方出的是剪刀!奖励你一个苹果!"
Case 2: MsgBox "你输了!对方出的是布哦!不好意思,苹果给对方了哈!"
End Select
Option1.Value = False
End Sub

Private Sub Option2_Click()
Randomize
Select Case Int(3 * Rnd)
Case 0: MsgBox "你输了!对方出的是石头哦!不好意思,苹果给对方了哈!"
Case 1: MsgBox "对方也出剪刀!继续!"
Case 2: MsgBox "哈哈!你赢了!对方出的是布!奖励你一个苹果!"
End Select
Option2.Value = False
End Sub

Private Sub Option3_Click()
Randomize
Select Case Int(3 * Rnd)
Case 0: MsgBox "哈哈!你赢了!对方出的是石头!奖励你一个苹果!"
Case 1: MsgBox "你输了!对方出的是剪刀哦!不好意思,苹果给对方了哈!"
Case 2: MsgBox "对方也出布!继续!"
End Select
Option3.Value = False
End Sub

回答3:

Dim pFist, cFist, cCount, pCount, dCount, tCount As Integer
Private Sub Form_Load()
cCount = 0
pCount = 0
dCount = 0
tCount = 1
lblPWinNum.Caption = ""
lblPWinNum.Caption = lblPWinNum.Caption & pCount
lblCWinNum.Caption = ""
lblCWinNum.Caption = lblCWinNum.Caption & cCount
lblDrawNum.Caption = ""
lblDrawNum.Caption = lblDrawNum.Caption & dCount
lblTotalNum.Caption = ""
lblTotalNum.Caption = lblTotalNum.Caption & tCount
End Sub
Private Sub imgCloth_Click()
pFist = 3
cFist = Int(Rnd * 3) + 1
txtPlayer.Text = ""
txtPlayer.Text = txtPlayer.Text & "布"
If cFist = 1 Then
txtComputer = ""
txtComputer = txtComputer & "石头"
Else
If cFist = 2 Then
txtComputer = ""
txtComputer = txtComputer & "剪刀"
Else
If cFist = 3 Then
txtComputer = ""
txtComputer = txtComputer & "布"
End If
End If
End If
If cFist = 1 Then
pCount = pCount + 1
lblPWinNum.Caption = ""
lblPWinNum.Caption = lblPWinNum.Caption & pCount
picSusess.Visible = True
MsgBox "恭喜你,你赢了!"
Else
If cFist = 2 Then
cCount = cCount + 1
lblCWinNum.Caption = ""
lblCWinNum.Caption = lblCWinNum.Caption & cCount
MsgBox "很遗憾,你输了!"
Else
dCount = dCount + 1
lblDrawNum.Caption = ""
lblDrawNum.Caption = lblDrawNum.Caption & dCount
MsgBox "打平了!"
End If
End If
tCount = tCount + 1
lblTotalNum.Caption = ""
lblTotalNum.Caption = lblTotalNum.Caption & tCount
End Sub
Private Sub imgScissors_Click()
pFist = 2
cFist = Int(Rnd * 3) + 1
txtPlayer.Text = ""
txtPlayer.Text = txtPlayer.Text & "剪刀"
If cFist = 1 Then
txtComputer = ""
txtComputer = txtComputer & "石头"
Else
If cFist = 2 Then
txtComputer = ""
txtComputer = txtComputer & "剪刀"
Else
If cFist = 3 Then
txtComputer = ""
txtComputer = txtComputer & "布"
End If
End If
End If
If cFist = 3 Then
pCount = pCount + 1
lblPWinNum.Caption = ""
lblPWinNum.Caption = lblPWinNum.Caption & pCount
picSusess.Visible = True
MsgBox "恭喜你,你赢了!"
Else
If cFist = 1 Then
cCount = cCount + 1
lblCWinNum.Caption = ""
lblCWinNum.Caption = lblCWinNum.Caption & cCount
MsgBox "很遗憾,你输了!"
Else
dCount = dCount + 1
lblDrawNum.Caption = ""
lblDrawNum.Caption = lblDrawNum.Caption & dCount
MsgBox "打平了!"
End If
End If
tCount = tCount + 1
lblTotalNum.Caption = ""
lblTotalNum.Caption = lblTotalNum.Caption & tCount
End Sub
Private Sub imgStone_Click()
pFist = 1
cFist = Int(Rnd * 3) + 1
txtPlayer.Text = ""
txtPlayer.Text = txtPlayer.Text & "石头"
If cFist = 1 Then
txtComputer = ""
txtComputer = txtComputer & "石头"
Else
If cFist = 2 Then
txtComputer = ""
txtComputer = txtComputer & "剪刀"
Else
If cFist = 3 Then
txtComputer = ""
txtComputer = txtComputer & "布"
End If
End If
End If
If cFist = 2 Then
pCount = pCount + 1
lblPWinNum.Caption = ""
lblPWinNum.Caption = lblPWinNum.Caption & pCount
picSusess.Visible = True
MsgBox "恭喜你,你赢了!"
Else
If cFist = 3 Then
cCount = cCount + 1
lblCWinNum.Caption = ""
lblCWinNum.Caption = lblCWinNum.Caption & cCount
MsgBox "很遗憾,你输了!"
Else
dCount = dCount + 1
lblDrawNum.Caption = ""
lblDrawNum.Caption = lblDrawNum.Caption & dCount
MsgBox "打平了!"
End If
End If
tCount = tCount + 1
lblTotalNum.Caption = ""
lblTotalNum.Caption = lblTotalNum.Caption & tCount
End Sub
Private Sub picSusess_Click()
picSusess.Visible = False
End Sub
我原来做的一个,按照你的提示加了一个图片,picSusess这个就是图片,里面放着一个苹果的图片,当你赢了就会出现,你点击一下,那个图片就消失,我这个里面除了你这个功能,还有战绩提示,统计你胜负平的局数和第多少局(计算公式是胜负平的局数+1,就是当前局数)