warning
This commit is contained in:
@@ -55,7 +55,6 @@ char *timeToText(time_t time);
|
|||||||
void nullScore(score *player_score);
|
void nullScore(score *player_score);
|
||||||
void winOrLoseLoop(dis *display_user,score *score_user, bool win);
|
void winOrLoseLoop(dis *display_user,score *score_user, bool win);
|
||||||
unsigned int scoreCalculator(score *score_user, bool win);
|
unsigned int scoreCalculator(score *score_user, bool win);
|
||||||
unsigned int scoreCalculatorCyp(score *score_user, bool win);
|
|
||||||
int inEditorLoop (char **tab2d, vect *dim_tab, vect *playerPos, vect *targets,
|
int inEditorLoop (char **tab2d, vect *dim_tab, vect *playerPos, vect *targets,
|
||||||
int nbr_targets, dis *display_user,score *score_user, int num_fichier);
|
int nbr_targets, dis *display_user,score *score_user, int num_fichier);
|
||||||
int titleScreen (dis *display_user);
|
int titleScreen (dis *display_user);
|
||||||
|
|||||||
@@ -478,10 +478,12 @@ int inEditorLoop (char **tab2d, vect *dim_tab, vect *playerPos, vect *targets,
|
|||||||
screenDisplayGameSDL (tab2d, *dim_tab, display_user, playerPos, fov,direction);
|
screenDisplayGameSDL (tab2d, *dim_tab, display_user, playerPos, fov,direction);
|
||||||
|
|
||||||
|
|
||||||
int GRID_SIZE = 20;
|
|
||||||
|
int GRID_SIZE = display_user->size_box;
|
||||||
int BLOCK_SIZE = (display_user->size_window - display_user->size_menu)/GRID_SIZE;
|
int BLOCK_SIZE = (display_user->size_window - display_user->size_menu)/GRID_SIZE;
|
||||||
int GRID_X_OFFSET =100;
|
int GRID_X_OFFSET =display_user->size_menu/2;
|
||||||
int GRID_Y_OFFSET =0;
|
int GRID_Y_OFFSET =0;
|
||||||
|
|
||||||
while (!finish)
|
while (!finish)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -915,7 +917,7 @@ void winOrLoseLoop(dis *display_user,score *score_user, bool win)
|
|||||||
displayImage(display_user->renderer, texture, pos, size);
|
displayImage(display_user->renderer, texture, pos, size);
|
||||||
|
|
||||||
char text[50] = "";
|
char text[50] = "";
|
||||||
snprintf(text, 50, "Score : %u",scoreCalculatorCyp(score_user, win));
|
snprintf(text, 50, "Score : %u",scoreCalculator(score_user, win));
|
||||||
vect pos_score = {10, (display_user->size_window*3) / 4};
|
vect pos_score = {10, (display_user->size_window*3) / 4};
|
||||||
vect size_score = {display_user->size_window / 4, display_user->size_window - 10};
|
vect size_score = {display_user->size_window / 4, display_user->size_window - 10};
|
||||||
displayTextSDL(display_user, text , pos_score, size_score, 80);
|
displayTextSDL(display_user, text , pos_score, size_score, 80);
|
||||||
@@ -938,19 +940,8 @@ void winOrLoseLoop(dis *display_user,score *score_user, bool win)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int scoreCalculator(score *score_user, bool win)
|
|
||||||
{
|
|
||||||
unsigned short int result = 65535; //plus grand nombre
|
|
||||||
int time = score_user->after - score_user->before;
|
|
||||||
result -= (score_user->move_box + score_user->move_player) * time;
|
|
||||||
if (!win)
|
|
||||||
{
|
|
||||||
result /= 50;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int scoreCalculatorCyp(score *score_user, bool win)
|
unsigned int scoreCalculator(score *score_user, bool win)
|
||||||
{
|
{
|
||||||
unsigned short int result = 10000; //plus grand nombre
|
unsigned short int result = 10000; //plus grand nombre
|
||||||
int time = score_user->after - score_user->before;
|
int time = score_user->after - score_user->before;
|
||||||
|
|||||||
Reference in New Issue
Block a user