Skip to content
Snippets Groups Projects
Commit 888ba9f7 authored by belkhiritaha's avatar belkhiritaha
Browse files

travail sur clignotement du joueur

parent 50714164
Branches
No related tags found
No related merge requests found
......@@ -182,7 +182,9 @@ void drawPlayer(){
rect.y = player.y ;
SDL_Rect destRect = {32 * (SDL_GetTicks()/200%6), 0, 32, 32};
int flip = (player.direction == PLAYER_LEFT) ? (SDL_FLIP_HORIZONTAL) : (SDL_FLIP_NONE);
int tick = SDL_GetTicks()%2;
if (player.isMoving){
SDL_SetTextureColorMod(playerIdleTexture, tick * 255 * (1 -player.invisible),tick * 255 * (1-player.invisible),tick * 255 * (1-player.invisible));
SDL_RenderCopyEx(renderer, playerTexture, &destRect, &rect, 0, NULL, flip);
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment