예제 #1
0
 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;
     }
 }
예제 #2
0
        protected override void HandleKeyDown(ConsoleKeyDownEventArgs args)
        {
            this.Hide();
            this.engine.GameStatus = GameStatusType.Welcome;

            ScreenBuffer.DrawScreen();
        }
예제 #3
0
        protected override void HandleKeyDown(ConsoleKeyDownEventArgs args)
        {
            this.Hide();
            this.engine.GameStatus = GameStatusType.Play;
            this.engine.StartTime += DateTime.Now - this.timeBeforePause;

            ScreenBuffer.DrawScreen();
        }
예제 #4
0
 private void Instance_KeyDown(object sender, ConsoleKeyDownEventArgs e)
 {
     if (this.GameStatus == GameStatusType.Play)
     {
         if (e.KeyInfo.Key == ConsoleKey.P)
         {
             this.GameStatus = GameStatusType.Pause;
         }
     }
 }
예제 #5
0
        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);
            }
        }
예제 #6
0
 private void Instance_KeyDown(object sender, ConsoleKeyDownEventArgs e)
 {
     this.HandleKeyDown(e);
 }
예제 #7
0
 protected abstract void HandleKeyDown(ConsoleKeyDownEventArgs args);
 protected override void HandleKeyDown(ConsoleKeyDownEventArgs args)
 {
     this.Hide();
 }