954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Timed getch()

Hello everyone!

I'm making a tetris program, and now I'm stucked a bit. I have to use the simple getch() function, but in a special way. I need to use it for exact time, and when the time is up, I need to break the function, even if I haven't got any characters entered.

It's for the horizontal movement of a brick - you have time to move it horizontally, but when the time is up, it moves one pixel vertically.

I hope, I was understandable.

vnorbi
Newbie Poster
1 post since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

Look at kbhit() . With that, getch() , and a timer you can do what you need.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: