Re: DT in BGT

@CAE,
Ok, the clock either isn't working correctly, DT isn't being returned correctly, or I am one dumb ass moron, lol:
class clock
{
timer time;
uint frame = 0;
double delay = 5;
double DT = time.elapsed*0.001;
in void tick(), I added a line to tell me what DT was each time the time ticked off:
void tick()
{
double elapsed=time.elapsed-delay+1;
if(time.elapsed >= 1000)
{
speaker.speak(time.elapsed + ", " + DT + ".");
time.restart();
}
time.resume();
wait((elapsed>=delay) ? 1 : delay-elapsed);
frame++;
}

When I execute, I get the following:
time.elapsed, 1004, DT, 0
time.elapsed, 1005, DT, 0
time.elapsed,  1002, DT, 0
Always 0 for DT, no matter what the elapsed is.
Also, a couple of other questions.  Could you explain this line of code, please?
wait((elapsed>=delay) ? 1 : delay-elapsed);
Second question.  In void tick, you say this:
if(time.elapsed >= 1000)
time.restart();
But then, you say in update:

bool update()
{
if (time.elapsed>=delay) {
time.restart();
So if it's restarting every time it hits delay, which in this case is 20 (1000.0/50), how does it ever reach 1000?

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : brian . kurosawa via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : brian . kurosawa via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector

Reply via email to