Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / hangman - used letter problem

Author
Message
needing_help
12
Years of Service
User Offline
Joined: 18th Nov 2013
Location: Colorado
Posted: 20th Nov 2013 10:49
Building a hangman game and have one final problem. The teacher has advised that we search this site and/or others to find the answer so any help is greatly appreciated. I need a way to letter the player know that they have already guessed a letter. Since they have already guessed this letter, it won't count against them i.e. a body part won't be added to the gallows. Additionally, I would like a way to keep the list of the guessed letters on the screen. Perhaps, off to the side in a small font. Or, have the alphabet with each guessed letter marked out/changed colors/something. Any suggestions?

Thanks!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 20th Nov 2013 13:02
Print/Text each letter to where you want them and if the player has guessed them highlight the guessed letters or make them invisible only showing the letters you have left.

"Get in the Van!" - Van B
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 20th Nov 2013 19:29 Edited at: 20th Nov 2013 19:47
You will need an array to store the letters that have been guessed. The easiest way would be to make an array element for each letter of the alphabet and have a boolean value for if it has been guessed or not.

I will put question marks where I think you can work out what to put there.



Formerly OBese87.

Login to post a reply

Server time is: 2026-07-06 20:16:58
Your offset time is: 2026-07-06 20:16:58