1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
while(continuer)
{
//tant qu'il y a un evenement à manipuler
while( SDL_PollEvent( &event ) )
{
//Si l'utilisateur ferme la fenetre avec le X
if( event.type == SDL_QUIT )
{
//On quitte le programme
continuer = 0;
}
}
//Obtenir les KeyStates
Uint8 *keystates = SDL_GetKeyState( NULL );
//Si Haut est pressé (la fleche)
if (keystates[ SDLK_e ])
{
positiondo.y = 25;
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sondo, 0, &channel);
}
if (keystates[ SDLK_r ]){
positionre.y = 25;
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sonre, 0, &channel);
}
if (keystates[ SDLK_t ]){
positionmi.y = 25;
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sonmi, 0, &channel);
}
//Mise à jours de l'ecran
if( SDL_Flip( ecran ) == -1 )
{
return 1;
} |
Partager