protected virtual void HandleKeyDown(ConsoleKeyDownEventArgs args) { if (args.KeyInfo.Key == ConsoleKey.Spacebar) { this.BulletShoot(); } else if (args.KeyInfo.Key == ConsoleKey.B) { this.ThrowBomb(); } else if (args.KeyInfo.Key == ConsoleKey.LeftArrow) { this.moveDirection = MoveDirectionType.Left; } else if (args.KeyInfo.Key == ConsoleKey.RightArrow) { this.moveDirection = MoveDirectionType.Right; } else if (args.KeyInfo.Key == ConsoleKey.DownArrow) { this.moveDirection = MoveDirectionType.Down; } else if (args.KeyInfo.Key == ConsoleKey.UpArrow) { this.moveDirection = MoveDirectionType.Up; } }
protected override void HandleKeyDown(ConsoleKeyDownEventArgs args) { this.Hide(); this.engine.GameStatus = GameStatusType.Welcome; ScreenBuffer.DrawScreen(); }
protected override void HandleKeyDown(ConsoleKeyDownEventArgs args) { this.Hide(); this.engine.GameStatus = GameStatusType.Play; this.engine.StartTime += DateTime.Now - this.timeBeforePause; ScreenBuffer.DrawScreen(); }
private void Instance_KeyDown(object sender, ConsoleKeyDownEventArgs e) { if (this.GameStatus == GameStatusType.Play) { if (e.KeyInfo.Key == ConsoleKey.P) { this.GameStatus = GameStatusType.Pause; } } }
protected override void HandleKeyDown(ConsoleKeyDownEventArgs args) { if (args.KeyInfo.Key == ConsoleKey.Enter) { this.Hide(); this.engine.GameStatus = GameStatusType.Play; this.engine.StartTime = DateTime.Now; ScreenBuffer.DrawScreen(); } else if (args.KeyInfo.Key == ConsoleKey.Escape) { Console.WriteLine("\n\nIf you see this it is because you've run the application with a debuger attached! Run the exe file outside Visual Studio."); Environment.Exit(0); } }
private void Instance_KeyDown(object sender, ConsoleKeyDownEventArgs e) { this.HandleKeyDown(e); }
protected abstract void HandleKeyDown(ConsoleKeyDownEventArgs args);
protected override void HandleKeyDown(ConsoleKeyDownEventArgs args) { this.Hide(); }