A voir également:
- SDL Event : Plusieur touche?
- Avoir celebi soulsilver sans event ✓ - Forum Jeux vidéo
- Échec du démarrage de la session « cloud files diagnostic event listener » avec l’erreur suivante : 0xc0000022 ✓ - Forum Jeux PC
- Hp system event utility c'est quoi - Forum Logiciels
- Quel programmes HP puis-je désinstaller? ✓ - Forum Windows
- (0xc0000022) - Forum Windows
2 réponses
On peut faire :
int touche_haut=0, touche_gauche=0;
...
Puis, dans te boucle :
sdl_WaitEvent(&event);
switch(event.type)
{
case SDL_KEYDOWN:
switch(event.key.keysym.sym)
{
case SDLK_LEFT:
touche_gauche++;
break;
case SDLK_UP:
touche_haut++;
break;
}
break;
case SDL_KEYUP:
switch(event.key.keysym.sym)
{
case SDLK_LEFT:
touche_gauche--;
break;
case SDLK_UP:
touche_haut--;
break;
}
break;
}
if(touche_haut==1 && touche_gauche==1)
{
//tes instructions
}
int touche_haut=0, touche_gauche=0;
...
Puis, dans te boucle :
sdl_WaitEvent(&event);
switch(event.type)
{
case SDL_KEYDOWN:
switch(event.key.keysym.sym)
{
case SDLK_LEFT:
touche_gauche++;
break;
case SDLK_UP:
touche_haut++;
break;
}
break;
case SDL_KEYUP:
switch(event.key.keysym.sym)
{
case SDLK_LEFT:
touche_gauche--;
break;
case SDLK_UP:
touche_haut--;
break;
}
break;
}
if(touche_haut==1 && touche_gauche==1)
{
//tes instructions
}