public void AnimateBees() { frame++; if (frame >= 6) { frame = 0; } switch (frame) { case 0: cell = 0; break; case 1: cell = 1; break; case 2: cell = 2; break; case 3: cell = 3; break; case 4: cell = 2; break; case 5: cell = 1; break; default: cell = 0; break; } hiveForm.Invalidate(); fieldForm.Invalidate(); }
public void RunFrame(object sender, EventArgs e) { framesRun++; world.Go(random); //renderer.Render(); end = DateTime.Now; TimeSpan frameDuration = end - start; start = end; UpdateStats(frameDuration); hiveForm.Invalidate(); fieldForm.Invalidate(); }