I'm writing a simple game in C with ncurses, and there's a problem. I want some things to move (enemies, projectiles) at all time, even while my character is stationary. What I have now is the character moving procedure, then the bullet/enemy moving procedure, one after another, in the main loop, so that the program is waiting for the input that will move the character before moving on to moving the enemies. What's the simplest way to fix this?
The nodelay option causes getch to be a non-blocking call. If no input is ready, getch returns ERR. If disabled (bf is FALSE), getch waits until a key is pressed.
>>1
Also, don't just put input and logic in the same place, it just won't work out in the long run.
Name:
Anonymous2009-06-02 19:24
>>6
she reinforced >>2-san's post. On an anonymous forum such as /prog, where one can not trust the accuracy of respondants' responses, reinforcement is most valuable.
Name:
Anonymous2009-06-02 19:25
>>7
Considering OP is building a curses app, I don't think she's going to be worried about program design :3