private void steppingTimer_Tick(object sender, EventArgs e) { float now = Environment.TickCount; float delta = (now - lastStep) / 1000; if (delta > 0) { tally.RegisterUpdate(); tally.RegisterInstances(world.AllChildren.LongCount()); world.FullUpdate(delta, true); lastStep = now; Refresh(); } }
private void steppingTimer_Tick(object sender, EventArgs e) //Actualiza el mundo y actualiza el Tally { float now = Environment.TickCount; float delta = (now - lastStep) / 1000; if (delta > 0) { long InstancesParticles = world.Explosion1.LongCount() + world.Explosion2.LongCount(); tally.RegisterUpdate(); tally.RegisterInstances(world.AllChildren.LongCount(), world.StarList.LongCount(), InstancesParticles); //Recibe la cantidad de instancias en AllChildren world.FullUpdate(delta, true); world.UpdateStars(delta); world.UpdateExplotionParticles(delta); lastStep = now; Refresh(); } }
private void steppingTimer_Tick(object sender, EventArgs e) { double now = Environment.TickCount; if (lastStep == null) { lastStep = now; } double delta = Math.Abs(now - lastStep.Value) / 1000; if (delta > 0) { tally.RegisterUpdate(); tally.RegisterInstances(world.AllChildren.LongCount()); world.FullUpdate((float)delta, true); lastStep = now; Refresh(); } }