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

entree du nom des joueurs

parent 67396d98
No related branches found
No related tags found
No related merge requests found
Pipeline #
# depslib dependency file v1.0
1460459876 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\affichageconsole.c
<stdio.h>
<stdlib.h>
<string.h>
"AffichageConsole.h"
"partie.h"
"joueur.h"
"joueurList.h"
"personnage.h"
"case.h"
1460459876 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\affichageconsole.h
"structures.h"
1462278696 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\structures.h
1462278681 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\partie.h
"structures.h"
1459764934 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\joueur.h
"structures.h"
1459764960 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\joueurlist.h
"structures.h"
1461253159 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\personnage.h
1462138721 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\case.h
"structures.h"
1460725190 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\affichageconsole2.c
<stdio.h>
<stdlib.h>
1462138721 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\carte.c
<stdio.h>
<stdlib.h>
......@@ -44,6 +10,8 @@
1462138721 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\carte.h
"structures.h"
1462295269 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\structures.h
1459762040 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\libs\libroxml-2.3.0\src\roxml.h
<stdio.h>
<stdlib.h>
......@@ -65,6 +33,8 @@
"roxml.h"
"TerrainsXML.h"
1462293472 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\personnage.h
1461279123 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\deplacements.h
1462138721 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\terrainsxml.h
......@@ -93,7 +63,7 @@
<roxml.h>
"ClassesXML.h"
1462278696 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\competence.c
1462287091 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\competence.c
<stdio.h>
<stdlib.h>
<roxml.h>
......@@ -102,18 +72,28 @@
1462278696 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\competence.h
1461253159 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\controleur.c
1462293472 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\controleur.c
<stdio.h>
<stdlib.h>
"partie.h"
"joueur.h"
"affichageConsole2.h"
"joueurList.h"
"case.h"
"personnage.h"
"classe.h"
"gamePackage.h"
1460725190 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\affichageconsole2.h
1462278681 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\partie.h
"structures.h"
1459764934 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\joueur.h
"structures.h"
1459764960 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\joueurlist.h
"structures.h"
1462138721 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\case.h
"structures.h"
1462278681 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\controleursdl.c
<stdlib.h>
......@@ -354,7 +334,7 @@
"structures.h"
"joueurList.h"
1462279594 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\main.c
1462293472 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\main.c
<stdio.h>
<stdlib.h>
"structures.h"
......@@ -365,21 +345,7 @@
"roxml.h"
"carte.h"
"Interface.h"
1461253159 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\mainpartieconsole.c
<stdlib.h>
<stdio.h>
<string.h>
"structures.h"
"controleur.h"
"partie.h"
"personnage.h"
"joueurList.h"
"joueur.h"
"affichageConsole2.h"
1460725190 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\controleur.h
"structures.h"
"gamePackage.h"
1462278681 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\partie.c
<stdio.h>
......@@ -415,18 +381,6 @@
"SDL.h"
"controleurSDL.h"
1462286071 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\sdl_bis.c
<stdio.h>
<stdlib.h>
<SDL/SDL.h>
<SDL/SDL_ttf.h>
"SDL.h"
1325818393 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\libs\sdl-1.2.15\include\sdl\sdl_ttf.h
"SDL.h"
"begin_code.h"
"close_code.h"
1462138721 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\terrain.c
<stdio.h>
<stdlib.h>
......@@ -443,3 +397,24 @@
"TerrainsXML.h"
"structures.h"
1462295606 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\sdl_bis.c
<stdio.h>
<stdlib.h>
<SDL/SDL.h>
<SDL/SDL_ttf.h>
"SDL.h"
"structures.h"
1325818393 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\libs\sdl-1.2.15\include\sdl\sdl_ttf.h
"SDL.h"
"begin_code.h"
"close_code.h"
1462293472 c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\gamepackage.h
1462293472 source:c:\users\henri\desktop\workspace-jeuc\lemeilleurjeudumonde\src\gamepackage.c
"structures.h"
"roxml.h"
"Interface.h"
"gamePackage.h"
......@@ -6,6 +6,7 @@
#include "structures.h"
int SDL_bis()
{ int quitter=0;
EtatsJeu etat=SAISIE_JOUEURS;
......@@ -59,17 +60,29 @@ int SDL_bis()
pos_logo.y=0;
pos_texte.x=(ecran->w-texte->w)/2;
pos_texte.y=ecran->h-200;
SDL_BlitSurface(texte,NULL,ecran,&pos_texte);
SDL_BlitSurface(logo,NULL,ecran,&pos_logo);
SDL_Flip(ecran);
char nom_joueur1[15] = "";
fgets(nom_joueur1, sizeof(nom_joueur1), stdin);
char nom_joueur1[TAILLE_NOMS] = "";
while(etat==SAISIE_JOUEURS)
{
SDL_WaitEvent(&event);
switch(event.type)
{
case SDL_QUIT:
etat=FERMER;
break;
}
SDL_BlitSurface(texte,NULL,ecran,&pos_texte);
SDL_BlitSurface(logo,NULL,ecran,&pos_logo);
SDL_Flip(ecran);
fgets(nom_joueur1, sizeof(nom_joueur1), stdin);
}
texte = TTF_RenderText_Shaded(police, "Entrez le nom du joueur 2", couleurBlanche,couleurNoire);
SDL_BlitSurface(texte,NULL,ecran,&pos_texte);
SDL_Flip(ecran);
char nom_joueur2[15] = "";
char nom_joueur2[TAILLE_NOMS] = "";
fgets(nom_joueur2, sizeof(nom_joueur2), stdin);
ajouterUnJoueur(nom_joueur1,&etat);
......@@ -88,19 +101,41 @@ int SDL_bis()
SDL_Flip(ecran);
while(quitter==0)
while(etat==LANCEMENT)
{
SDL_WaitEvent(&event);
switch(event.type)
{
case SDL_QUIT:
quitter=1;
etat=FERMER;
break;
case SDL_MOUSEBUTTONDOWN:
if (event.button.x<pos_texte.x+texte->w&&event.button.x>pos_texte.x&&event.button.y<pos_texte.y+texte->h&&event.button.y>pos_texte.y)
{etat=CONFIGURATION;}
break;
default:
break;
}
SDL_BlitSurface(texte,NULL,ecran,&pos_texte);
SDL_BlitSurface(logo,NULL,ecran,&pos_logo);
SDL_BlitSurface(texte,NULL,ecran,&pos_texte);
SDL_BlitSurface(rectangle,NULL,ecran,&pos_texte);
SDL_Flip(ecran);
}
while(etat==CONFIGURATION)
{
SDL_WaitEvent(&event);
switch(event.type)
{
case SDL_QUIT:
etat=FERMER;
break;
case SDL_MOUSEBUTTONDOWN:
if (event.button.x<pos_texte.x+texte->w&&event.button.x>pos_texte.x&&event.button.y<pos_texte.y+texte->h&&event.button.y>pos_texte.y)
etat=CONFIGURATION;
break;
}
}
return 0;
}
......@@ -72,7 +72,8 @@ typedef enum {SAISIE_JOUEURS,
TOUR_J2P3,
J2P3_DEPLACEMENT,
J2P3_ATTAQUE,
VICTOIRE
VICTOIRE,
FERMER
}EtatsJeu;
/*! \struct Skins_Charac structures.h
......
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