Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
still need help (reading keypresses simultaneously)
I get the concept of making a table of keys pressed. I have gotten to the point now, that I can read all the keys that are pressed and set their value in the array to 1 indicating that they have been pressed. The only problem now is that I don't know how to see if the key is done being pressed or not. I need to know how to code a keyDown() function for this. (I am using Turbo C++ 3.0)
In case it helps any, I am making a modified clone of Asteroids with a two player mode. It is necessary that I can read both players' key commands. After all, what is the point of a space shooter if you have to take turns shooting each other? I have studied a few other people's code, but as I am pretty new to programming, I can't understand the code very well. If there is any way to put things more simply, please do so. Specifically, I have noticed a line that is quite similar in several programs. It looks similar to the following:
keys=(keyboard far *)MK_FP(0x40,0x17);
Thanks in advance for any help anyone can offer!