Advaned keyboard input
I'm making a game and I have a problem.
For example I want that when I press the arrow keys on the keyboard the ball will move across the screen with a slow speed and when I hold the spacebar while moving the ball with the arrow keys, the ball will move faster...
How do I know whether the spacebar is hold (pressed down) while pressing other keys like the arrow keys... :confused:
Please help me and thank you! :p
I use Borland C++ 3.0 (DOS)
I don't think they (C++) can "see" two keys at once.
Yes they most certainly can. If C can not use two keys at once, how is it possible to play DOS games like Doom where you are running AND shooting, using the arrow and ctrl?
Of course it is possible. I just don't know how its done. Andre Lamothe explains it in his book "Teach yourself game programming in 21 days", but I haven't read over that part in over 2 years.
He used Microsoft C, but Borland C can do it too. I would need to look it up.
You must write a keyboard handler. Look for info on this - it is all over this board - everywhere.