Skip to content
Snippets Groups Projects
Commit 00b51cd2 authored by antoinemeyer5's avatar antoinemeyer5
Browse files

ajout de voir/pas voir le Hub avec la touche H

parent 8b0f6786
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,13 @@ void gestGame() ...@@ -104,6 +104,13 @@ void gestGame()
Keys[1] = 1; Keys[1] = 1;
continue; continue;
case SDLK_h:
if(showHub == 0){
showHub = 1;
}else{
showHub = 0;
}
default: default:
break; break;
} }
......
...@@ -11,6 +11,8 @@ SDL_Rect rect; ...@@ -11,6 +11,8 @@ SDL_Rect rect;
SDL_Rect sky; SDL_Rect sky;
SDL_Rect ground; SDL_Rect ground;
int showHub = 0;
SDL_Texture *netTexture; SDL_Texture *netTexture;
SDL_Texture *netEdgeLeftTexture; SDL_Texture *netEdgeLeftTexture;
SDL_Texture *netEdgeRightTexture; SDL_Texture *netEdgeRightTexture;
...@@ -1010,6 +1012,12 @@ void drawInfosBall() ...@@ -1010,6 +1012,12 @@ void drawInfosBall()
drawString(str_ballZ, screenDimension.w - 120, 300, 100, 50, 255, 255, 255, 255); drawString(str_ballZ, screenDimension.w - 120, 300, 100, 50, 255, 255, 255, 255);
} }
void drawHub(){
drawFPS();
drawInfosPlayer();
drawInfosBall();
}
void drawGame() void drawGame()
{ {
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
...@@ -1030,9 +1038,11 @@ void drawGame() ...@@ -1030,9 +1038,11 @@ void drawGame()
drawVerticalNet(); drawVerticalNet();
} }
drawMap2D(map); drawMap2D(map);
drawFPS(); //affiche le hub
drawInfosPlayer(); if(showHub){
drawInfosBall(); drawHub();
}
SDL_RenderPresent(renderer); SDL_RenderPresent(renderer);
} }
......
...@@ -37,8 +37,11 @@ extern SDL_DisplayMode screenDimension; ...@@ -37,8 +37,11 @@ extern SDL_DisplayMode screenDimension;
extern int * ray1; extern int * ray1;
extern int * ray2; extern int * ray2;
extern int showHub;
void castSingleRay(float angle, float *distanceWall, float *distanceNet, int *returnXWall, int *returnYWall, int *returnXNet, int *returnYNet); void castSingleRay(float angle, float *distanceWall, float *distanceNet, int *returnXWall, int *returnYWall, int *returnXNet, int *returnYNet);
void drawString(char *str, int x, int y, int w, int h, int r, int g, int b, int a); void drawString(char *str, int x, int y, int w, int h, int r, int g, int b, int a);
void mainLoop(); void mainLoop();
void drawHub();
#endif #endif
\ No newline at end of file
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