Я искал в коде crossbow, как реализованно то, что стрелы не сразу поражают стену, а сначала летят до нее. Нашел что-то связанное с volume, как я понял, это не громкость. Не подскажите, как это сделать, допустим, у МР5?
Well i bet if you can delay TakeDamage you can also delay TraceAttack somehow.
But wait, ahh ! I guess wanna make this "realistic" gun impact. Well i can tell you that with delaying stuff you won't make it perfect, at last it will get annoying.
If there is not any delay functions in game engine itself maybe you can work out something with this :
code:
#include <ctime>
#include <sys/time.h>
void Delay ( int iMilliseconds )
{
time_t t = time ( NULL );
timeval u; gettimeofday ( &u, NULL );
t *= 1000; t += u.tv_usec / 1000;
do
gettimeofday ( &u, NULL );
while ( ( time ( NULL ) * 1000 ) + ( u.tv_usec / 1000 ) < t + iMilliseconds );
}
And simply call it by Delay(integer);
__________________
настоящий мужчина не нуждается в подписи.