Esempio n. 1
0
int main()
{
    int x,y;  // position joueur
    int touche;
    x = y = 1;
    touche = 0;
    while(touche!=27) // ECHAP
    {
        Afficher(x,y);
        touche = MyGetch();
        switch(touche)
        {
        case 'q':
            TryMove(&x,&y,0,-1);
            break;
        case 'd':
            TryMove(&x,&y,0,1);
            break;
        case 'z':
            TryMove(&x,&y,-1,0);
            break;
        case 's':
            TryMove(&x,&y,1,0);
        default:
            break;
        }
    }
    return 0;
}
Esempio n. 2
0
void FlushKeys(void)
{
	while (MyKbhit()) {		/* Any keys pending? */
		MyGetch();			/* Remove from queue */
	}
	memset((char *)KeyArray,0,sizeof(KeyArray));	/* Clear out the keydown array */
}