r/visualbasic • • Oct 05 '20

Help

Post image
10 Upvotes

4 comments sorted by

5

u/i_dontknowwww Oct 05 '20

Im trying to create a game in vb and idk why this isnt working every time i input "search" it dosn't let me input forwards (note i did have While one = "search -anything") and one = inputbox - area ")

5

u/Bonejob VB Guru Oct 05 '20

Take out the while loop, and replace it with something like

If one = "Search" then
  msgbox...
end if
if one = "forwards" then 
 {do stuff here}
end if

Secondly this should not be a user control project. I would suggest that you look at doing this as a console app first while you are learning to code then upgrade it to a winform interface.

Oh and check this out :)

VB.NET 2013: Text Based Game (Part 1/6)

2

u/i_dontknowwww Oct 05 '20

i figured it out but thanks for the input i made it :

While One = "search" = True

If One = "search" Then MsgBox("You don't find anything")

If One = "search" = True Then One = InputBox("You wake up in a cave all you have is a sword and a way forwards (Input- [forwards] to move forwards into the next room or Input Search to [search] the area")

End While

(it works now)

1

u/NakeleKantoo Oct 22 '20

i didnt undestand what u needed but hey, if its working great job my man