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); end = DateTime.Now; TimeSpan frameDuration = end - start; start = end; UpdateStats(frameDuration); hiveForm.Invalidate(); fieldForm.Invalidate(); }