I'm new at C++ but have been programming in other languages too, so i'm not a total beginner.
I want to make simple games in the command prompt. But i need an IF statement to check if an arrow key is hold down.
I don't want an event. Cus last time i got this output:
1 2 3 4 5 6 7
Running...
Key is down...
Running...
Running...
Key is down...
Key is down...
Key is down...
If you open up Word or another texteditor, try to hold down the K key, and you will find out that it starts typing K one time, then after some miliseconds it will start "spamming" with the K key.
The same happened in my game. And i don't want that delay between the 1st K and the next...
I already posted this question on another forum. But no1 could answer :( I hope you do! (:
- Anders4000
You need a game library. Programming games in the console is hell. Try the Allegro game library, it's the one that I use. There's also wxwidgets, or openGL if you're looking for 3d.
Only problem is that i get so damn confused installing and downloading such. Installing is very complicated, and i've tried with 2-3 libs and it never worked. What program you use for the coding? Code::Blocks?
try this go to step 2 here: http://wiki.allegro.cc/index.php?title=Code::Blocks
I use linux, so I would suggest asking in the windows porgramming forum on setup and so on. Once you have allegro, it's really easy to make simple games.