G day ,im a parent from Australia.
My child is 7 turning 8 and i would like to create a simple hangman game in visual basic that he can use.
I am fairly new to visual basic only having dealt with arrays,algorithms all the basic via a programming text book( that i no longer have...:( )
id please like to know the logistics of making the game.
This is how id like it to work,ive investigated different games....
i would like it to have a text box where you enter a single letter into it at any time and then obviously if its wrong, the wrong letter disappears, no longer being able to click.

Would someone please be able to think of the simplest possible way for me to do this,its important for me to not have it done by someone else and to make this game for my son myself.
I would like to be able to change/add the words in the game in the code,so that my son wont get bored :)

this is my first post and problem and i have heard this is a very friendly board,if you can assist me then thank you very much!

Recommended Answers

All 8 Replies

Member Avatar for iamthwee

If you're completely new to programming I'd recommend getting a book.

Hi Tripsturr,

I'd recommend keeping the words on a MSSQL backend (or Access) if you want to have the ability to keep adding them. If you're not familiar with databases you can always use an XML file, they are pretty easy to grasp and don't require SQL syntax to work with them. VB.Net makes working with either of these very easy, especially XML.

As for the logic of the game...I guess that depends how hard core you want to get with hangman. I have only played the game a few times. You'll definitely want to keep track of the letters that have already been used by the user and have them on screen for his ease.

When it comes to the graphics portion of the game, you could draw a bunch of images and each time he gets a question wrong, replace the image to simulate the actual drawing. Keep in mind updating the GUI is a bit more difficult in .Net as you may encounter thread exeptions, so in the event you run into that obstacle, look into invocation and delegates.

That should put you on the right path, so get started and have fun! I think you've got a great project and will learn a ton about VB.Net during it!

Good luck and keep us posted.

Here are some code samples from Microsoft that may help you :) Here is another resouce you may find handy.

Member Avatar for iamthwee

>I'd recommend keeping the words on a MSSQL backend (or Access)

No offence but that is overkill, for something this simple. Given the experience of the OP, or lack thereof, storing the words in an array or text file (if you wish to add others) will suffice.

thanx so far,
id just like to clarify that id like to solely use VB to make the program.i think ill just go into the code and change/add new words when my son gets bored etc.

Id like for the game to be really simple ;with the words being randomly selected ,each letter of the random word being part of an array,and having the images of the hangman appear when a guessed letter matches one of the letters in the array.

im guessing part of the code would be something like this..

If text1 = text2
Then Image.Show

i have also written some pseudo code to start it off

fullword = "jungle";
word = ("j","u","n","g","l","e");
player = ("-","-","-","-","-","-");

while (win = false) {
     print "So far, you have.. " + player;
     print "What is your next guess? ";
     input guess;

     for (i = 0; i < 6; i++) {
          if (guess = word[i]) {
               player[i] = guess;
          }
     }

     checker = player[0] + player[1] + player[2] + player[3] + player[4] + player[5];
     if (checker = word[6]) {
          win = true;
     }
}

print "You win!";

i have got a visual basic book from a library and it has all the basics on everything ,but im still stumped as how to start things off in terms of actually writing the code.What things in the book should i focus on in this type of game???

as you can see from my pseudo code,each letter from the word will be split up into an array.

i know most of you are experts at visual basic etc. but im just a novice please assist me with what ive done so far,thank you!

Please could i get some assistance ,anyone???

Member Avatar for iamthwee

Sure which part are you having trouble with?

Member Avatar for iamthwee

Hmm I wonder if you are using vb or vb.net - this is the vb.net forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.