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
| while (continuer){
SDL_WaitEvent(&event);
switch(event.type){
case SDL_QUIT:
continuer =0;
break;
case SDL_KEYDOWN:
switch(event.key.keysym.sym){
case SDLK_ESCAPE:
continuer =0;
break;
case SDLK_UP:
pacmanActuel = pacman[HAUT];
deplacerJoueur(carte, &positionJoueur, HAUT,pscore);
break;
case SDLK_DOWN:
...
default:
break;
}
default:
break;
}
// Effacement de l'ecran
SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 0, 0, 0));
//Déplacement des fantômes
for (i =0 ; i<4; i++){
deplacementFantome(carte,&ghost[i],&positionJoueur);
}
// Placement des objets a l'ecran
....
} |
Partager