私は大学での仕事の一部として、機能的な戦闘システムを備えたゲームとゲームのスプラッシュプログラムに取り組んできました。これはVisual Studioで行われていますが、問題があります。VB.Netコーディングエラー
あなたが戦闘に従事するように設定しているときはいつでも、私はこのエラーを与えています:ここで http://prntscr.com/duswke
は、エラーが発生しているコードです:
Console.WriteLine("You have arrived at the " & Place(randomNum) & " aboard your ship")
System.Threading.Thread.Sleep(1000)
Console.WriteLine("You look around to check for hostiles...")
System.Threading.Thread.Sleep(5000)
Enemy(1) = "An enemy runs towards you and engages with you in combat!"
Enemy(2) = "You see nothing around you but stars, It's all clear"
Randomize()
randomNum2 = Int(Int((2 * Rnd()) + 1))
Console.WriteLine("" & Enemy(randomNum2) & "")
If Enemy(1) Then
System.Threading.Thread.Sleep(5000)
Console.Clear()
Call Sub() Combat()
ElseIf Enemy(2) Then
Console.Clear()
Console.WriteLine("You have found some treasure deep within the " & Place(randomNum) & " ")
System.Threading.Thread.Sleep(2000)
Console.WriteLine("Continue Adventuring?")
Console.Clear()
Call Sub() Combat()
End If
基本的に起こることになっていただきましれますConsole.WriteLine( "1 - Attack") Console.WriteLine() Console.WriteLine( "2 - Inventory") Console.WriteLine( "1 - 攻撃")コンソールをクリアして戦闘メニューを開きます。 ) Console.WriteLine( "3-Run") Console.WriteLine()) そして一度それが開いていれば、chrMenu Charを使って選択して実行することができますし、オプションを実行すると、 "If Enemy )それはすべきではありません。どんな助けもありがとうございます。
「もし敵なら(1)それで?」で何が起こると期待していましたか? – Jonesopolis
これはVB.NETなのですか?それは間違いなくCのようには見えません# –
あなたがあなたがコーディングしているものを知っているなら、それは役に立ちます。間違いなくC#です。それはVB.NETです。もう少し学び、より小さなチャンクを行うことが賢明であると考えてください。 – Bugs