-
I really need help
i am stuck and darn stuck i am trying to make a kunar lander like this in c++
Play LunarLander Game
in this program i am stuck at the fireing rocket stage
i need a function that tell me the duration i have pressed a key
e.g
i press "A" or any key it gives me the time from when i press A and leave it in millisecond
-
Well it all depends on your operating system and compiler, and whether you're writing a console or GUI program.
-
thnx for the rply
i am doing this with c++,
borland 5 or turbo 3.2
windows xp & 7
not gui console based
-
use a game programming tool..like xna or allegro or ... (opengl :( )
i assume it will be a pain in the butt to do it with command line
-
Can either of those compilers generate win32 programs?
If not, you should consider upgrading to something more in tune with your real operating system. Relying on backward compatibility will only get you so far...
Win32 Console Applications 5
With this, you can also add timing to see how long it took between various key events.
-
?
i have done my project to quiet an extent but am stuck am doing my bachlour so am stuck with c++...i cant seem to sove this issue
-
You won't get a WndProc in console mode but I think you can use GetAsyncKeyState(). If you can use that (I'm not sure b/c I almost never use console mode) then start a timer when it is down and stop the timer when it is up. Subtract the start time from the end time and you will know how long the key has been held down.