Jump to content
  • Advertisement
Sign in to follow this  
Slyfox

using a control pad to select letters.

This topic is 4487 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

right basically what I am doing at the moment is, i've written hangman and it works and compiles fine. But I need to make it so that the user can select the letter they want to guess using a joypad. The way i figured i could do it would be to write a vector to hold all the letters of the alphabet. then use iterators to iterate throught the letters if up on the joypad is pressed. however in terms of displaying it on the screen i can only think of cout playerGuess; but this would print repeated letters to the screen can anyone think how to get round this? Also how could I then take this information in like via cin?

Share this post


Link to post
Share on other sites
Advertisement
I don't think cin handles input events so much as processes strings of characters. It's been a while since I've made console programs, though.

Try googling for getchar(), or getch(), or something like that. I'm sure somebody knows the function I mean.

Share this post


Link to post
Share on other sites
You won't be able to handle Joypad input on the Standard I/O Streams, since a Joypad isn't a Standard I/O Device. QED
Quote:
Original post by Slyfox
The way i figured i could do it would be to write a vector to hold all the letters of the alphabet.

then use iterators to iterate throught the letters if up on the joypad is pressed.

Just have a character that is the current letter, and add or subtract one from it whenever the letter is changed. 'B' == 'A' + 1;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!