Writing Tetris in C --Graphics?

Started by
12 comments, last by Caminman 21 years, 2 months ago
Hi,

May i have a look at your ascii tetris?

Thnx
Advertisement
Well well, I chose Allegro, and it really was easy to get things on the screen & play midi. The thing I''m struggling with right now is I can''t get any input to the prog.. And it somehow jumps over the readkey() function, even though I clear the buffer (which makes readkey() wait for input).. :/


Anonymous Poster:
Sure thing, where do you want it posted?

  install_keyboard();if(key[KEY_UP]) {  // do something }if(key[KEY_DOWN]) {  // do something else }  


The rest of the keys you can check for:


  KEY_A ... KEY_Z,KEY_0 ... KEY_9,KEY_0_PAD ... KEY_9_PAD,KEY_F1 ... KEY_F12,KEY_ESC, KEY_TILDE, KEY_MINUS, KEY_EQUALS,KEY_BACKSPACE, KEY_TAB, KEY_OPENBRACE, KEY_CLOSEBRACE,KEY_ENTER, KEY_COLON, KEY_QUOTE, KEY_BACKSLASH,KEY_BACKSLASH2, KEY_COMMA, KEY_STOP, KEY_SLASH,KEY_SPACE,KEY_INSERT, KEY_DEL, KEY_HOME, KEY_END, KEY_PGUP,KEY_PGDN, KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN,KEY_SLASH_PAD, KEY_ASTERISK, KEY_MINUS_PAD,KEY_PLUS_PAD, KEY_DEL_PAD, KEY_ENTER_PAD,KEY_PRTSCR, KEY_PAUSE,KEY_ABNT_C1, KEY_YEN, KEY_KANA, KEY_CONVERT, KEY_NOCONVERT,KEY_AT, KEY_CIRCUMFLEX, KEY_COLON2, KEY_KANJI,KEY_LSHIFT, KEY_RSHIFT,KEY_LCONTROL, KEY_RCONTROL,KEY_ALT, KEY_ALTGR,KEY_LWIN, KEY_RWIN, KEY_MENU,KEY_SCRLOCK, KEY_NUMLOCK, KEY_CAPSLOCK  
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
Thanks, although I solved it already.
Stupid me forgot the install_keyboard(
I had it there, but then it disappeared

This topic is closed to new replies.

Advertisement