I'm trying to make a mathematics game in Borland C++ v4.52.

My game consists of multiple mathematical problems moving down the screen, while the user is able to enter the answer to any of these problems. Once the user has entered the problem, the problem disappears.

My problem is that I cannot figure out a way to simultaneously allow the user to input answers to the questions and have the mathematical problems moving down the screen.

Thank you in advance.

10 Years
Discussion Span
Last Post by Ancient Dragon

use threads. But I don't know if they are supported by your compiler. If not then next best thing is to call kbhit() (see conio.h) to see if a key has been hit. If it has, then call a function to process the keyboard data. If not then do the mathamatical operations. You will need to do this in a main program loop, something like this:

for(;;) // forever loop
    if( kbhit() )
            // process keyboard data
    // do math problems here

Do you realize there is an entire forum devoted to games ?


Those are your options -- take them or leave them. The other alternative is to use a gaming engine such as DirectX, but you need more C or C++ experience to use it. My suggestion is that you set this ambitious project aside for a few months until you get a good grasp of C++.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.