'插入3个text,一个command
Private Sub form_load()
Text1.Text = "1000" '血量
Text2.Text = "500" '魔
Text3.Text = "400" '对手
End Sub
Private Sub command1_click()
If Text1.Text = "0" Or Text2.Text = "0" Then
MsgBox "无法攻击!"
Else:
Do
Text1.Text = Text1.Text - 100
Text2.Text = Text2.Text - 20
Text3.Text = Text3.Text - 200 '你的攻击力暂定为200
Loop Until Text3.Text = "0"
MsgBox "本轮进攻胜利!"
End If
Text3.Text = "400"
End Sub
if语句里面判断情况,然后msgbox弹出对话框。