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.

Recommended Answers

All 4 Replies

Why do't you put down here some code ,i will try to help you.

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 ?

Thank you for your answer, it's a great help.

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++.

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.