|
Bad Input system in my code? |
Zdravko
Member #6,994
March 2006
|
In my program there are a lot of computations. If the user presses 'q' the program must quit. If the user presses 'r' some stuff must be drawed and then pause before the compuations continue. void do_sim() bool user_input() void wait() |
Michael Faerber
Member #4,800
July 2004
|
If I was you, I would clean up your code at first. Separate your drawing functions from your key input functions. Maybe the problem solves itself after that ... [EDIT] -- |
Elverion
Member #6,239
September 2005
|
Please use code tags next time. That's pretty difficult to read as is. Anyways, I would suggest you change your input to be more like this:
I haven't actually tested this code, but it should work. I've written similar code to this for doing pause screens (with embedded menus even), so the idea behind it works, though there might be a bug here or there. I hope this helps you in some way. -- |
|