diff --git a/travail_de_groupe/jeu_appren_par_renfo/Res/player_sprite.png b/travail_de_groupe/jeu_appren_par_renfo/Res/player_sprite.png new file mode 100755 index 0000000000000000000000000000000000000000..8447510ba0888073e187f8a1859a2b325b00c0d4 Binary files /dev/null and b/travail_de_groupe/jeu_appren_par_renfo/Res/player_sprite.png differ diff --git a/travail_de_groupe/jeu_appren_par_renfo/src/render.c b/travail_de_groupe/jeu_appren_par_renfo/src/render.c index 0a719e01aca3fd5f7659f2ecc6ab08b2ffbd8318..549d723b0fea1c7f8fd0b1a1653ab4864ab5f0b1 100644 --- a/travail_de_groupe/jeu_appren_par_renfo/src/render.c +++ b/travail_de_groupe/jeu_appren_par_renfo/src/render.c @@ -13,6 +13,7 @@ SDL_Rect ground; SDL_Texture * netTexture; SDL_Texture * crowdTexture; +SDL_Texture * playerTexture; int ** rays; int raysListLength = 0; @@ -405,10 +406,12 @@ void drawEnnemy(){ rect.w = (ennemyWidth * screenDimension.w) / (ennemyDistance/BLOCK_SIZE); rect.h = (ennemyHeight * screenDimension.h)/(ennemyDistance/BLOCK_SIZE); + destRect.x = 0; + destRect.y = 0; + destRect.w = 64; + destRect.h = 64; //printf("%d %d %d %d\n", rect.x, rect.y, rect.w, rect.h); - SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); - SDL_RenderFillRect(renderer, &rect); - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderCopy(renderer, playerTexture, &destRect, &rect); } } @@ -500,6 +503,7 @@ void mainLoop(){ netTexture = loadTexture("Res/net.png"); crowdTexture = loadTexture("Res/crowd.png"); + playerTexture = loadTexture("Res/player_sprite.png"); unsigned int a = SDL_GetTicks(); unsigned int b = SDL_GetTicks();