Exemplo n.º 1
0
static void timerCallback (int value) { 
	tetris.MoveDown();

/* call back again after elapsedUSecs have passed */
    glutTimerFunc (tetris.msecs, timerCallback, value);
	display();
}
Exemplo n.º 2
0
void keyboard(unsigned char Key, int x, int y){
	switch(Key){
		case 'j':
			tetris.MoveDown();
			break;
		case 'k':
			tetris.MoveRotate();
			break;
		case 'h':
			tetris.MoveLeft();
			break;
		case 'l':
			tetris.MoveRight();
			break;
		default:
		break;
	};
	display();
}