Re: DT in BGT
So, the time thing is to calculate the actual physics equations correctly. For example, take this equation:
velocity = initial velocity plus acceleration multiplied by time
According to the person who is in physics, the initial way I did it where I did:
VF.x = (V).x+A.x)*DT...
is incorrect. You do not multiply by DT, but rather T, actual time. Then, when you actually move the ball, that is when you use DT.
position = velocity multiplied by DT.
That's why you need some way to actually get time.
As for the sound thing, you are confused. I wasn't referring to sound of impact on the ball or the ball bouncing. I was referring to the actual sound of the ball as it travels through the air. The only way that I can think to make it work correctly is to have that sound play every x number of frames, because if I don't, the sound goes so fast that it's a buzzing that is so loud and overwhelms everything. If I have it play every x number of frames, it plays correctly. Not sure if there's a better way to do it. The sound had nothing to do with impact or bouncing. Not sure what made you think that, since when the ball hits the ground, I call a separate method entirely for bounce outside of move:
if(pos.z <= 0)
{
moving = false;
bounce();
}
This part:
if(C.frame == 50)
{
B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);
C.frame = 0;
}
Is for the ball as it travels through the air. I hope that clears up the confusion.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector