diff options
| -rw-r--r-- | menuchoixpersos.c | 44 | ||||
| -rw-r--r-- | prototypes.h | 1 | 
2 files changed, 13 insertions, 32 deletions
| diff --git a/menuchoixpersos.c b/menuchoixpersos.c index cc217a8..2d20ef2 100644 --- a/menuchoixpersos.c +++ b/menuchoixpersos.c @@ -65,34 +65,26 @@ void Fmenuchoixpersos (SURFACES *surfaces, POSITIONS *positions)                  {                      case SDLK_LEFT:                      case SDLK_h: -                    if(Vchoix>PALADIN) -                    { -                        Vchoix--; +                        if (Vchoix > PALADIN) { +                            Vchoix--; +                        } else { +                            Vchoix=VOLEUR; +                        }                          Fchangersurlignage2 (Vchoix,surfaces,positions); -                    } -                    else -                    { -                        Vchoix=VOLEUR; -                        Fchangersurlignage2 (Vchoix,surfaces,positions); -                    } -                    break; + +                        break;                      case SDLK_RIGHT:                      case SDLK_l: -                    if (Vchoix<VOLEUR) -                    { -                        Vchoix++; +                        if (Vchoix < VOLEUR) { +                            Vchoix++; +                        } else { +                            Vchoix = PALADIN; +                        }                          Fchangersurlignage2 (Vchoix,surfaces,positions); -                    } -                    else -                    { -                        Vchoix=PALADIN; -                        Fchangersurlignage2 (Vchoix,surfaces,positions); -                    }                      break;                      case SDLK_RETURN:                      case SDLK_f: -                    Fremplirpersos (Vchoix,persos,Vnbperso); -                    Vnbperso++; +                    persos[Vnbperso++].classe = Vchoix;                      continuer = false;                      break;                      default: @@ -123,16 +115,6 @@ void Fchangersurlignage2 (int Vchoix, SURFACES *surfaces, POSITIONS *positions)      SDL_Flip (surfaces->Pecran);  } -void Fremplirpersos (int Vchoix, PERSONNAGES persos[],int Vnbpersos) -{ -    if (Vchoix==PALADIN) -        persos[Vnbpersos].classe=PALADIN; -    else if (Vchoix==PRETRE) -        persos[Vnbpersos].classe=PRETRE; -    else if (Vchoix==VOLEUR) -        persos[Vnbpersos].classe=VOLEUR; -} -  void Fremplirpersos2 (SURFACES *surfaces, PERSONNAGES persos[])  { diff --git a/prototypes.h b/prototypes.h index b6401b9..65591db 100644 --- a/prototypes.h +++ b/prototypes.h @@ -6,7 +6,6 @@ void Fchangersurlignage (int Vmode, SURFACES *surfaces, POSITIONS *positions);  int Fentrermode (int Vmode, SURFACES *surfaces, POSITIONS *positions);  void Fmenuchoixpersos (SURFACES *surfaces, POSITIONS *positions);  void Fchangersurlignage2 (int Vperso, SURFACES *surfaces, POSITIONS *positions); -void Fremplirpersos (int Vperso, PERSONNAGES persos[],int Vnbpersos);  void Fremplirpersos2 (SURFACES *surfaces, PERSONNAGES persos[]);  int Fjouer (SURFACES *surfaces, POSITIONS *positions, PERSONNAGES persos[],ENNEMIS ennemis[]);  void Fblitterpersos (SURFACES *surfaces, POSITIONS *positions, PERSONNAGES persos[]); | 
