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

Ajout de la vision de l'appartenance du camp du personnage en jeu dans la...

Ajout de la vision de l'appartenance du camp du personnage en jeu dans la partie de droite de l'écran
parent 6101d428
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -253,7 +253,8 @@ char* afficherListeClasses(char** nomsClasses, char** skinsClasses, int nbChoix) ...@@ -253,7 +253,8 @@ char* afficherListeClasses(char** nomsClasses, char** skinsClasses, int nbChoix)
* \param les noms des attaques et leur nombre * \param les noms des attaques et leur nombre
* \return le nom de l'attaque choisie * \return le nom de l'attaque choisie
*/ */
char* choix_attaque(char** noms_attaques, int nb_attaques){ char* choix_attaque(char** noms_attaques, int nb_attaques)
{
int i,quitter; int i,quitter;
char* attaque_choisie=NULL; char* attaque_choisie=NULL;
SDL_Surface* fenetre=NULL; SDL_Surface* fenetre=NULL;
...@@ -768,6 +769,7 @@ int affichage_carte() ...@@ -768,6 +769,7 @@ int affichage_carte()
SDL_Surface* nombre_deplacement = NULL; SDL_Surface* nombre_deplacement = NULL;
SDL_Surface* camp_1 = NULL; SDL_Surface* camp_1 = NULL;
SDL_Surface* camp_2 = NULL; SDL_Surface* camp_2 = NULL;
SDL_Surface* camp_x = NULL;
SDL_Rect pos_perso; SDL_Rect pos_perso;
SDL_Rect pos_PV; SDL_Rect pos_PV;
...@@ -780,6 +782,7 @@ int affichage_carte() ...@@ -780,6 +782,7 @@ int affichage_carte()
SDL_Rect pos_bouton3; SDL_Rect pos_bouton3;
SDL_Rect pos_personnage_numero; SDL_Rect pos_personnage_numero;
SDL_Rect pos_nombre_deplacement; SDL_Rect pos_nombre_deplacement;
SDL_Rect pos_campx;
TTF_Font *vieille_police = NULL; TTF_Font *vieille_police = NULL;
TTF_Font *police_arial = NULL; TTF_Font *police_arial = NULL;
...@@ -873,6 +876,8 @@ int affichage_carte() ...@@ -873,6 +876,8 @@ int affichage_carte()
pos_nom_joueur.y=pos_texte.y+(3*texte->h)/2; pos_nom_joueur.y=pos_texte.y+(3*texte->h)/2;
pos_perso.x=ecran->w-(LARGEUR_BORDURE+perso->w)/2; pos_perso.x=ecran->w-(LARGEUR_BORDURE+perso->w)/2;
pos_perso.y=ecran->h/4; pos_perso.y=ecran->h/4;
pos_campx.x=ecran->w-(LARGEUR_BORDURE+perso->w)/2;
pos_campx.y=ecran->h/4;
pos_personnage_numero.x=ecran->w-(LARGEUR_BORDURE+personnage_numero->w)/2; pos_personnage_numero.x=ecran->w-(LARGEUR_BORDURE+personnage_numero->w)/2;
pos_personnage_numero.y=pos_perso.y+perso->h; pos_personnage_numero.y=pos_perso.y+perso->h;
pos_PV.x=ecran->w-(LARGEUR_BORDURE-25); pos_PV.x=ecran->w-(LARGEUR_BORDURE-25);
...@@ -904,6 +909,16 @@ int affichage_carte() ...@@ -904,6 +909,16 @@ int affichage_carte()
} }
Position_Case_brillante=Position_Case[0][0]; Position_Case_brillante=Position_Case[0][0];
perso_actuel=perso_suivant(perso_actuel);
if(perso_actuel <=3)
{
camp_x = camp_1;
}
else
{
camp_x = camp_2;
}
while(etat!=FERMER) while(etat!=FERMER)
{ {
SDL_WaitEvent(&event); SDL_WaitEvent(&event);
...@@ -930,12 +945,17 @@ int affichage_carte() ...@@ -930,12 +945,17 @@ int affichage_carte()
sprintf(buffer_PV, "Mana : %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); sprintf(buffer_PV, "Mana : %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel));
mana=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); mana=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
if(perso_actuel <=3){ if(perso_actuel <=3)
{
sprintf(buffer_PV, "Personnage %d", perso_actuel); sprintf(buffer_PV, "Personnage %d", perso_actuel);
personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
}else{ camp_x = camp_1;
}
else
{
sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO); sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO);
personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
camp_x = camp_2;
} }
perso=persos[perso_actuel-1]; perso=persos[perso_actuel-1];
} }
...@@ -950,12 +970,17 @@ int affichage_carte() ...@@ -950,12 +970,17 @@ int affichage_carte()
sprintf(buffer_PV, "Mana : %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel)); sprintf(buffer_PV, "Mana : %d/%d", obtenirManaPersonnage(perso_actuel),obtenirManaMaxPersonnage(perso_actuel));
mana=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); mana=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
if(perso_actuel <=3){ if(perso_actuel <=3)
{
sprintf(buffer_PV, "Personnage %d", perso_actuel); sprintf(buffer_PV, "Personnage %d", perso_actuel);
personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
}else{ camp_x = camp_1;
}
else
{
sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO); sprintf(buffer_PV, "Personnage %d", perso_actuel-NB_PERSO);
personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire); personnage_numero=TTF_RenderText_Shaded(police_arial, buffer_PV, couleurBlanche, couleurNoire);
camp_x = camp_2;
} }
perso=persos[perso_actuel-1]; perso=persos[perso_actuel-1];
} }
...@@ -1005,9 +1030,12 @@ int affichage_carte() ...@@ -1005,9 +1030,12 @@ int affichage_carte()
} }
} }
for(i=0; i<LARGEUR_CARTE; i++){ for(i=0; i<LARGEUR_CARTE; i++)
for(j=0; j<HAUTEUR_CARTE; j++){ {
if(case_accessible(perso_actuel,Position_Case[j][i].x,Position_Case[j][i].y)){ for(j=0; j<HAUTEUR_CARTE; j++)
{
if(case_accessible(perso_actuel,Position_Case[j][i].x,Position_Case[j][i].y))
{
SDL_BlitSurface(Case_brillante,NULL,ecran,&Position_Case[j][i]); SDL_BlitSurface(Case_brillante,NULL,ecran,&Position_Case[j][i]);
} }
} }
...@@ -1016,9 +1044,12 @@ int affichage_carte() ...@@ -1016,9 +1044,12 @@ int affichage_carte()
for(i=0; i<NB_PERSO*NB_JOUEURS; i++) for(i=0; i<NB_PERSO*NB_JOUEURS; i++)
{ {
SDL_BlitSurface(persos[i],NULL,ecran,&Position_Perso[i]); SDL_BlitSurface(persos[i],NULL,ecran,&Position_Perso[i]);
if(i<NB_PERSO){ if(i<NB_PERSO)
{
SDL_BlitSurface(camp_1,NULL,ecran,&Position_Perso[i]); SDL_BlitSurface(camp_1,NULL,ecran,&Position_Perso[i]);
}else{ }
else
{
SDL_BlitSurface(camp_2,NULL,ecran,&Position_Perso[i]); SDL_BlitSurface(camp_2,NULL,ecran,&Position_Perso[i]);
} }
} }
...@@ -1034,6 +1065,7 @@ int affichage_carte() ...@@ -1034,6 +1065,7 @@ int affichage_carte()
SDL_BlitSurface(bouton3,NULL,ecran,&pos_bouton3); SDL_BlitSurface(bouton3,NULL,ecran,&pos_bouton3);
SDL_BlitSurface(mana,NULL,ecran,&pos_mana); SDL_BlitSurface(mana,NULL,ecran,&pos_mana);
SDL_BlitSurface(perso,NULL,ecran,&pos_perso); SDL_BlitSurface(perso,NULL,ecran,&pos_perso);
SDL_BlitSurface(camp_x,NULL,ecran,&pos_campx);
SDL_BlitSurface(personnage_numero,NULL,ecran,&pos_personnage_numero); SDL_BlitSurface(personnage_numero,NULL,ecran,&pos_personnage_numero);
SDL_BlitSurface(nombre_deplacement,NULL,ecran,&pos_nombre_deplacement); SDL_BlitSurface(nombre_deplacement,NULL,ecran,&pos_nombre_deplacement);
......
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