史上最无尽的游戏制作方法

来源:互联网 发布:js在线翻译 编辑:程序博客网 时间:2024/04/29 10:53

代码:

Public score As Integer
Sub ns()
    score_T.Caption = score
End Sub


Private Sub c_Click()
    score = score + 1
    c.Left = Rnd * 10000
    c.Top = Rnd * 6500
    o.Left = Rnd * 10000
    o.Top = Rnd * 6500
    g.Left = Rnd * 10000
    g.Top = Rnd * 6500
    If Rnd > 0.5 Then
        g.Enabled = False
    Else
        g.Enabled = True
    End If
    c.Enabled = False
    c.Enabled = True
    ns
End Sub

Private Sub close_Click()
    End
End Sub

Private Sub Form_Load()
    score = 0
    ns
End Sub

Private Sub g_Click()
    score = score + 5
    c.Left = Rnd * 10000
    c.Top = Rnd * 6500
    o.Left = Rnd * 10000
    o.Top = Rnd * 6500
    g.Left = Rnd * 10000
    g.Top = Rnd * 6500
    g.Enabled = False
    c.Enabled = False
    c.Enabled = True
    ns
End Sub
步骤:一个窗体(7800*12300)、一个Label控件 名字:score_T(显示分数)、三个按钮名字:c o g、其中一个设Enabled = false 完工

原创粉丝点击