Results 1 to 4 of 4

Thread: help with hangman game!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    24

    help with hangman game!!

    I posted a thread yesterday which unfortunately wasn't sufficient as one programmer suggested.
    My problem at the moment is i can read throgh all the files ie txt
    and images, but the problem is coming when i run the programme and
    deliberately enter wrong input.
    E.g the guessed word maybe Monday, if i deliberately enter a wrong
    entry e.g Z, it's calling the relevant image file i.e image1 and if i
    then enter N which is part of the secrect word it displays but if i
    again enter another wrong entry, my image 2 is not showing.
    i know the problem might be on the guessing loop but I am finding it rather hard to tro
    troubleshoot.
    Last edited by Interger; Mar 27th, 2007 at 11:17 AM.

  2. #2
    Fanatic Member
    Join Date
    May 2005
    Posts
    608

    Re: help with hangman game!!

    The scope of found is incorrect.

    Remove it from the top of the class and add it inside the Form1_KeyPress event as Dim found as string = "0" .
    This way, each time it enters the Form1_KeyPress event it starts with 0.

    You should check into how scope works and define better types for your variables.
    Instead of found being a string, make it a boolean with true/false, for example.

    Have fun creating your game.

    HTH,
    HoraShadow
    I do like the reward system. If you find that my post was useful, rate it.

  3. #3
    Fanatic Member
    Join Date
    May 2005
    Posts
    608

    Re: help with hangman game!!

    To trouble shoot you have very powerful tools inside Visual Studio.

    You should check into adding break points, and using the immediate window to query variable values when the project is in pause mode.

    You also have the debug tool bar in the Visual Studio designer, that let's you go line by line of code (key F11).

    You should also check the Watch, Quick Watch and Local windows on Visual Studio, they give great information and it's very simple to use them.

    HTH,
    HoraShadow
    I do like the reward system. If you find that my post was useful, rate it.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    24

    Re: help with hangman game!!

    Finally i've managed to resolve it, all credit to your advice HoraShadow,
    Thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width