A friend of mine and I are making a snake game and getch doesnt seem to be working as a control scheme (it stops the program and waits for input, whereas we need it to continue even if they dont input anything) I remember when Ihsir posted his "aim" game he mentioned that he used bioskey instead of getch. I was wondering if using this would solve our problem, and if you can even use it in MS VC++... If it could, a tutorial of some sort would be much appreciated.
bioskey is no longer used...
Unfortunately that puts me exactly where i was: nowhere.
what about trying
So the loop only executes when a key is hit.
bioskey will also wait for a keypress. i think try what lambs4 suggests.
i think that to have independent movement of 2 or more things it might require some complicated programming.
you could also check the FAQs or somewhere else on the site for the snake game. I vaguely remember it is there with the code.
You can also try something like
Then the loop will execute, but if the user hits a key it will appear in the variable inputchar. You can then put if statements in the code depending on what inputchar is. This is what I usually do.
if (kbhit()) inputchar = getch();
Also, some compilers have other functions than kbhit() that do the same thing in its place - check the relevent help file.