| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1121 人关注过本帖
标题:我这辈子编的第一个游戏!
取消只看楼主 加入收藏
tiancaiak
Rank: 2
等 级:论坛游民
威 望:1
帖 子:111
专家分:43
注 册:2006-9-17
结帖率:100%
收藏
 问题点数:0 回复次数:1 
我这辈子编的第一个游戏!

一个关于幸运52的游戏,改了我一个星期啊,5555~~~(果然还是菜)
虽然有些错,但自己实再是找不出来,哎~~ 还请高手帮忙!不胜感激!
错误:我的图片会重复出现,但我不想这样,要怎样改呢?
啥也不多说了,激动ing...
我靠!!!
程序发不上来
发代码吧

Dim i, n, j, k, s, temp, t, p, prize(0 To 2) As Integer, a(0 To 10) As Integer
Dim sname(0 To 2) As String


Private Sub Command1_Click()
Timer1.Enabled = True
Randomize
n = Int(3 * Rnd)
If i = 0 Then
a(i) = n
ElseIf i > 0 Then
Do While 1 <> 0
If i = 3 Then
MsgBox "没有东西了", 0 + 64, "你真强"
MsgBox "不给你玩儿了", 0 + 64, "走喽~~"
End
End If
For j = 0 To i - 1
If a(j) = n Then
k = 1
End If
Next j
If k = 1 Then
n = Int(3 * Rnd)
ElseIf k = 0 Then
Exit Do
End If
Loop
a(i) = n
i = i + 1
End If
Text1.SetFocus
Text1.Text = ""
Label1.Caption = sname(n)
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
If n = 0 Then
Image1.Visible = True
ElseIf n = 1 Then
Image2.Visible = True
ElseIf n = 2 Then
Image3.Visible = True
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
If Text1.Text = "" Then
MsgBox "你想吃霸王餐!!", 0 + 64, "门儿都没有!"
Text1.SetFocus
End If
If Text1.Text <> "" Then
p = Int(Text1.Text)
If p < prize(n) Then
MsgBox "低了!", 0, "价格"
Text1.SetFocus
Text1.Text = ""
ElseIf p > prize(n) Then
MsgBox "高了!", 0, "价格"
Text1.SetFocus
Text1.Text = ""
ElseIf p = prize(n) Then
MsgBox "恭喜!", 0, "猜对了!"
s = s + prize(n)
Call Command1_Click
End If
End If
End Sub

Private Sub Form_Load()

sname(0) = "电脑"
sname(1) = "手机"
sname(2) = "MP3"
t = 30
i = 0
prize(0) = 19
prize(1) = 32000
prize(2) = 588
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(0) Or KeyAscii > Asc(9) Then
Beep
MsgBox "非法字符", 0, "输入"
KeyAscii = 0
End If
End Sub

Private Sub Timer1_Timer()
Static i As Integer
t = t - 1
Label2.Caption = Str(t) & "秒"
If t = 0 Then
MsgBox "时间到", 0 + 64, "哦,BABY~~"
MsgBox "您得了" & s & "元的东东", 0 + 64, "强"
Timer1.Enabled = False
End
End If
End Sub

搜索更多相关主题的帖子: 游戏 
2006-09-29 21:00
tiancaiak
Rank: 2
等 级:论坛游民
威 望:1
帖 子:111
专家分:43
注 册:2006-9-17
收藏
得分:0 

时隔两个月,问题已经基本解决.
呵呵~ 真是谢谢大家了


2006-11-11 21:02
快速回复:我这辈子编的第一个游戏!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026983 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved