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.

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

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.