VBScript内置对象与游戏开发实战
1. 脚本回顾与挑战
在之前的脚本中,有一段用于让玩家选择单词类别的代码:
Loop until a valid category strSelection has been made
Do Until blnValidResponse = “True”
‘Prompt the player to select a word category
strChoice = InputBox(“Please specify the name of a word category “ & _
“from which game words will be selected.” & vbCrLf & vbCrLf & _
“Available Categories:” & vbCrLf & vbCrLf & _
strSelection, “Pick a Category” , “General”)
‘If input is not in master string the player must try again
If InStr(UCase(strFileString), UCase(strChoice)) = 0 Then
MsgBox “Sorry but this is not a valid category. Please try again.”
Else
blnValidResponse = “True”
End If
Loop
‘I
超级会员免费看
订阅专栏 解锁全文
1246

被折叠的 条评论
为什么被折叠?



