Pong, mltiplayer

I'm trying to make a 2 player Pong console game. To move the counter (up and down) on the left side, I use 'W' and 'S', and on the right side I use 'I' and 'K'. I use the getch function to receive the character. However, I can't seem to move both the counters at the same time. Is there a way to have 2 parallel getch statements? or is there another function to do the same? If it's needed, I use a borland compiler.
Last edited on
The console is not designed for making games. No, there is not a way to do this. Use your platform's specific methods to detect key presses.
How do I do that?
Last edited on
Correct me if I'm wrong, but shouldn't it work just fine if this program is multithreaded?
@Siddharth Srinivasan: As mentioned before, the console is not designed for this sort of thing. To get more than one you would need to look up the OS documentation, or you could look up how to make it multithreaded. I highly recommend though, getting a library which will deal with these for you as dealing with the OS API is painful.
Oh ok, thanks a lot.
I managed to make a substitute using kbhit() but i still lags a lot because, you know, the console :)
I literally just started Cpp, so I'm kinda like a beginner. Can you link me to some good tutorials?
Preferably Video..
Thanks all the same =)
There is an EXCELLENT tutorial over here:
http://www.cplusplus.com/doc/
There may be some ones on Youtube but people who are good at programming usually aren't good at commentating, and let's face it: everyone pronounces things differently and thus can confuse you, so reading text tutorials will be better for your comprehension.
Thanks =)
well on youtube I got alot of help from TheNewBoston and as a plus he teaches more then C++ he also goes over html, java, python and Javascript and a ton of other stuff

http://www.youtube.com/user/thenewboston?blend=1&ob=4
Topic archived. No new replies allowed.