debut du title menu
This commit is contained in:
@@ -622,6 +622,44 @@ int inEditorLoop (char **tab2d, vect *dim_tab, vect *playerPos, vect *targets,
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief La fonction permet de faire la boucle de l'éditeur.
|
||||
* \param tab2d Le tableau 2d carre.
|
||||
|
||||
* \return renvoie -2 ce qui signifie l'editeur
|
||||
*/
|
||||
int titleScreen (char **tab2d, vect *dim_tab, dis *display_user)
|
||||
{
|
||||
char input;
|
||||
bool finish = false;
|
||||
SDL_Event event;
|
||||
|
||||
|
||||
while (!finish)
|
||||
{
|
||||
|
||||
while (SDL_PollEvent (&event))
|
||||
{
|
||||
if (event.type == SDL_KEYDOWN)
|
||||
{
|
||||
input = event.key.keysym.scancode;
|
||||
switch (input)
|
||||
{
|
||||
case SDL_SCANCODE_RETURN:
|
||||
playAudio(0);
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Delay (16);
|
||||
}
|
||||
return -3;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Cette fonction verrifie si la partie est gagnante.
|
||||
* \param tab2d Le tableau 2D du jeu.
|
||||
|
||||
Reference in New Issue
Block a user