Since my download timer shows 15minutes till DPs RTS engine is done, I would like to reprhase my previous question since noone answered it :-/
Should I have a single function to handle both players?
a) yes: Should I have a whole bunch of statics variables to hold the previous state of the player (since I obviously don't have any input functions in do_something())? Or is there a better way?
b) no: Then what?
For all of you who are cratching your head with getch() and kbhit(): go to http://www.talula.demon.co.uk/allegro/ and download Allegro (read the FAQ first about your compiler). After that it's all very easy:
Code:
#include <allegro.h>
#include <stdio.h>
int main()
{
allegro_init();
install_keyboard();
while(!key[KEY_ESC])
{
if(key[KEY_W])
printf("Player 1 pressed a key\n");
if(key[KEY_UP])
printf("Player 2 pressed a key\n");
rest(50);
}
return 0;
}