Animacja postaci

0

Cześć,podpowie mi ktoś jak mógłbym zrobić animacje ruchu nóg mojej postaci w grze?

2

Hej, podpowie ktoś, jak wymienić silnik w moim samochodzie?

0
:
 frame++;
        if( frame > 80 ){ 
            frame = 0;
            } 
          
    if( key[ KEY_LEFT] ) 
    { postac_x--;
    if( frame < 20 ) { draw_sprite( bufor, postac0, postac_x, postac_y ); }
else if( frame >= 20 && frame < 40 ) { draw_sprite( bufor, postac1, postac_x, postac_y ); }
else if( frame >= 40 && frame < 60 ) { draw_sprite( bufor, postac2, postac_x, postac_y ); }
else if( frame >= 60 && frame < 80 ) { draw_sprite( bufor, postac3, postac_x, postac_y ); }
    }
   else
   {
       masked_blit(postac,bufor,0,0,postac_x,postac_y,postac->w,postac->h);
       }
        if(postac_x <= 0) 
{
  postac_x=0; 
}
    frame++;
        if( frame > 80 ) {
            frame = 0;
            }
    if( key[ KEY_RIGHT ] )  
    { postac_x++; 
    if( frame < 20 ) { draw_sprite( bufor, postac0, postac_x, postac_y ); }
else if( frame >= 20 && frame < 40 ) { draw_sprite( bufor, postac1, postac_x, postac_y ); }
else if( frame >= 40 && frame < 60 ) { draw_sprite( bufor, postac2, postac_x, postac_y ); }
else if( frame >= 60 && frame < 80 ) { draw_sprite( bufor, postac3, postac_x, postac_y ); }
    }
    else {
    masked_blit(postac,bufor,0,0,postac_x,postac_y,postac->w,postac->h);
} 

animacja działa tylko w lewą stronę , wie ktoś gdzie tutaj jest błąd ?

0

Problem już udało mi się rozwiązać.

1 użytkowników online, w tym zalogowanych: 0, gości: 1