private void InitiateGame() { service.InitiateNewGame(); bird = new BirdController(service.GetBirdControllerModel()); environment = new EnvironmentController(service.GetEnvironmentControllerModel()); if (fixedUpdate != null) { fixedUpdate.Stop(); fixedUpdate.Dispose(); } if (acceleratedUpdate != null) { acceleratedUpdate.Stop(); acceleratedUpdate.Dispose(); } fixedUpdate = new Timer(service.GetRefreshInterval()); acceleratedUpdate = new Timer(service.GetNewFrameLength()); fixedUpdate.Elapsed += OnFixedUpdate; acceleratedUpdate.Elapsed += OnUpdate; fixedUpdate.AutoReset = true; acceleratedUpdate.AutoReset = true; fixedUpdate.Enabled = true; acceleratedUpdate.Enabled = true; }
public void Render(IEnvironmentController environmentInstance, IBirdController birdInstance) { var render = baseRender.Clone() as char[, ]; AddEnvironmentToRender(render, environmentInstance); AddBirdToRender(render, birdInstance); var line = new (Color color, string value)[config.ScreenWidth];
public InputBird(IInput inputManager, IBirdController birdController) { this.inputManager = inputManager; this.birdController = birdController; }