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()
Keys[1] = 1;
continue;
case SDLK_h:
if(showHub == 0){
showHub = 1;
}else{
showHub = 0;
}
default:
break;
}
......
......@@ -11,6 +11,8 @@ SDL_Rect rect;
SDL_Rect sky;
SDL_Rect ground;
int showHub = 0;
SDL_Texture *netTexture;
SDL_Texture *netEdgeLeftTexture;
SDL_Texture *netEdgeRightTexture;
......@@ -1010,6 +1012,12 @@ void drawInfosBall()
drawString(str_ballZ, screenDimension.w - 120, 300, 100, 50, 255, 255, 255, 255);
}
void drawHub(){
drawFPS();
drawInfosPlayer();
drawInfosBall();
}
void drawGame()
{
SDL_RenderClear(renderer);
......@@ -1030,9 +1038,11 @@ void drawGame()
drawVerticalNet();
}
drawMap2D(map);
drawFPS();
drawInfosPlayer();
drawInfosBall();
//affiche le hub
if(showHub){
drawHub();
}
SDL_RenderPresent(renderer);
}
......
......@@ -37,8 +37,11 @@ extern SDL_DisplayMode screenDimension;
extern int * ray1;
extern int * ray2;
extern int showHub;
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 mainLoop();
void drawHub();
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment