incredibly true...the linear way is very bad. make a game engine. if you would like an example of one, check out my site.
This is a discussion on 2 player RTS within the Game Programming forums, part of the General Programming Boards category; incredibly true...the linear way is very bad. make a game engine. if you would like an example of one, check ...
incredibly true...the linear way is very bad. make a game engine. if you would like an example of one, check out my site.
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; }
kooma - t.h@iki.fi