Skip to content
Snippets Groups Projects
Commit 607c2988 authored by Montjoie Henri's avatar Montjoie Henri
Browse files

ajout du mana

parent bdf437cd
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -668,11 +668,13 @@ int affichage_carte()
SDL_Rect Position_Case_brillante;
SDL_Surface* PV = NULL;
SDL_Surface* mana = NULL;
SDL_Surface* texte = NULL;
SDL_Surface* nom_joueur = NULL;
SDL_Surface* bouton1 = NULL;
SDL_Surface* bouton2 = NULL;
SDL_Rect pos_PV;
SDL_Rect pos_mana;
SDL_Rect pos_texte;
SDL_Rect pos_nom_joueur;
SDL_Rect pos_bouton1;
......@@ -690,9 +692,11 @@ 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[9];
sprintf(buffer_PV, "%d/%d", obtenirPVPersonnage(perso_actuel),obtenirPVMaxPersonnage(perso_actuel));
char buffer_PV[20];
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);
pos_texte.x=ecran->w-(LARGEUR_BORDURE+texte->w)/2;
pos_texte.y=20;
......@@ -704,6 +708,8 @@ int affichage_carte()
pos_bouton1.y=pos_bouton2.y-(2*bouton2->h);
pos_PV.x=ecran->w-(LARGEUR_BORDURE+PV->w)/2;
pos_PV.y=pos_nom_joueur.y+(2*nom_joueur->h);
pos_mana.x=ecran->w-(LARGEUR_BORDURE+mana->w)/2;
pos_mana.y=pos_PV.y+(2*PV->h);
for(i=0; i<LARGEUR_CARTE; i++)
{
......@@ -770,16 +776,20 @@ int affichage_carte()
case SDL_MOUSEBUTTONDOWN:
if(event.button.y>pos_bouton1.y&&event.button.y<pos_bouton1.y+bouton1->h){
perso_actuel=perso_suivant(perso_actuel);
sprintf(buffer_PV, "%d/%d", obtenirPVPersonnage(perso_actuel),obtenirPVMaxPersonnage(perso_actuel));
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);
}
if(event.button.y>pos_bouton2.y&&event.button.y<pos_bouton2.y+bouton2->h){
finDuTour();
debutDuTour();
nom_joueur= TTF_RenderText_Shaded(vieille_police, obtenirNomJoueurCourant(), couleurBlanche, couleurNoire);
perso_actuel=actualiser_num_perso(perso_actuel);
sprintf(buffer_PV, "%d/%d", obtenirPVPersonnage(perso_actuel),obtenirPVMaxPersonnage(perso_actuel));
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);
}
if(event.button.x<LARGEUR_CARTE*LARGEUR_CASE){
//deplacement_personnage(event.button.x,event.button.y);
......@@ -836,6 +846,7 @@ int affichage_carte()
SDL_BlitSurface(nom_joueur,NULL,ecran,&pos_nom_joueur);
SDL_BlitSurface(bouton1,NULL,ecran,&pos_bouton1);
SDL_BlitSurface(bouton2,NULL,ecran,&pos_bouton2);
SDL_BlitSurface(mana,NULL,ecran,&pos_mana);
SDL_Flip(ecran);
}
......@@ -851,6 +862,7 @@ int affichage_carte()
SDL_FreeSurface(Case_brillante);
SDL_FreeSurface(perso_select);
SDL_FreeSurface(texte);
SDL_FreeSurface(mana);
SDL_FreeSurface(nom_joueur);
SDL_FreeSurface(bouton1);
SDL_FreeSurface(bouton2);
......
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