private void update_frame_animation(){
        switch(pacman_direction){
            case UP:
                current_animation_index = tmp_animation_index++ % up_animation_length;
                if(tmp_animation_index % up_animation_length == 0)tmp_animation_index = 0;
                break;
            case DOWN:
                current_animation_index = tmp_animation_index++ % down_animation_length;
                if(tmp_animation_index % down_animation_length == 0)tmp_animation_index = 0;
                break;
            case LEFT:
                current_animation_index = tmp_animation_index++ % left_animation_length;
                if(tmp_animation_index % left_animation_length == 0)tmp_animation_index = 0;
                break;
            case RIGHT:
                current_animation_index = tmp_animation_index++ % right_animation_length;
                if(tmp_animation_index % right_animation_length == 0)tmp_animation_index = 0;
                break;
            default:
                current_animation_index = current_animation_index++ % right_animation_length;
                if(tmp_animation_index % up_animation_length == 0)tmp_animation_index = 0;
        }
    }