Skip to content
Snippets Groups Projects
Commit 729b886d authored by Lénaïg Le Moigne's avatar Lénaïg Le Moigne
Browse files

Ajout de la vision du nombre de déplacement restant par personnage.

parent 13e4e79a
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -694,6 +694,7 @@ int affichage_carte()
SDL_Surface* bouton1 = NULL;
SDL_Surface* bouton2 = NULL;
SDL_Surface* personnage_numero = NULL;
SDL_Surface* nombre_deplacement = NULL;
SDL_Rect pos_perso;
SDL_Rect pos_PV;
SDL_Rect pos_mana;
......@@ -702,6 +703,7 @@ int affichage_carte()
SDL_Rect pos_bouton1;
SDL_Rect pos_bouton2;
SDL_Rect pos_personnage_numero;
SDL_Rect pos_nombre_deplacement;
TTF_Font *vieille_police = NULL;
TTF_Font *police_arial = NULL;
......@@ -718,13 +720,15 @@ int affichage_carte()
bouton1= TTF_RenderText_Shaded(vieille_police, "Perso suivant", couleurDoree, couleurBleue);
bouton2= TTF_RenderText_Shaded(vieille_police, "Joueur suivant", couleurDoree, couleurBleue);
char buffer_PV[30];
char buffer_PV[40];
sprintf(buffer_PV, "PV: %d/%d", obtenirPVPersonnage(perso_actuel),obtenirPVMaxPersonnage(perso_actuel));
PV=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire);
sprintf(buffer_PV, "Mana: %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel));
mana=TTF_RenderText_Shaded(vieille_police, buffer_PV, couleurBlanche, couleurNoire);
sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO);
personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
sprintf(buffer_PV, "Deplacement : %d", obtenirPDPersonnage(perso_actuel));
nombre_deplacement=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
pos_texte.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2;
pos_texte.y=20;
......@@ -742,6 +746,8 @@ int affichage_carte()
pos_perso.y=pos_mana.y+(2*mana->h);
pos_personnage_numero.x=ecran->w-(LARGEUR_BORDURE+mana->w)/2.4;
pos_personnage_numero.y=pos_perso.y+(2*PV->h);
pos_nombre_deplacement.x=ecran->w-(LARGEUR_BORDURE+mana->w)/2.4;
pos_nombre_deplacement.y=pos_personnage_numero.y+(2*PV->h);
for(i=0; i<LARGEUR_CARTE; i++)
{
......@@ -801,6 +807,7 @@ int affichage_carte()
}
Position_Case_brillante=Position_Case[0][0];
while(etat!=FERMER)
{
SDL_WaitEvent(&event);
......@@ -896,6 +903,8 @@ int affichage_carte()
{
SDL_BlitSurface(persos[i],NULL,ecran,&Position_Perso[i]);
}
sprintf(buffer_PV, "Deplacement : %d", obtenirPDPersonnage(perso_actuel));
nombre_deplacement=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
SDL_BlitSurface(perso_select,NULL,ecran,&Position_Perso[perso_actuel-1]);
SDL_BlitSurface(Case_brillante,NULL,ecran,&Position_Case_brillante);
SDL_BlitSurface(PV,NULL,ecran,&pos_PV);
......@@ -906,6 +915,7 @@ int affichage_carte()
SDL_BlitSurface(mana,NULL,ecran,&pos_mana);
SDL_BlitSurface(perso,NULL,ecran,&pos_perso);
SDL_BlitSurface(personnage_numero,NULL,ecran,&pos_personnage_numero);
SDL_BlitSurface(nombre_deplacement,NULL,ecran,&pos_nombre_deplacement);
SDL_Flip(ecran);
}
......@@ -932,6 +942,7 @@ int affichage_carte()
SDL_FreeSurface(PV);
SDL_FreeSurface(ecran);
SDL_FreeSurface(personnage_numero);
SDL_FreeSurface(nombre_deplacement);
TTF_CloseFont(vieille_police);
TTF_CloseFont(police_arial);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment