Exemplo n.º 1
0
        public void Update(long delta)
        {
            if (Keyboard.IsKeyDown(Key.Escape))
            {
                _game.BackScreen().BackScreen();
                return;
            }
            if (!MouseState.IsMouseMove())
            {
                return;
            }
            var mouse = MouseState.GetMouseDown();

            if (!mouse.IsEmpty && Intersection(_posRepeat, mouse))
            {
                var tetrisGame = _screen as TetrisGame;
                if (tetrisGame != null)
                {
                    _game.BackScreen();
                    tetrisGame.Repeat();
                    return;
                }
            }
            if (!mouse.IsEmpty && Intersection(_posMenu, mouse))
            {
                _game.BackScreen().BackScreen();
                return;
            }
            if (!mouse.IsEmpty && Intersection(_posExit, mouse))
            {
                _game.Exit();
            }
            Redraw();
        }
Exemplo n.º 2
0
 private void Window_LostFocus(object sender, RoutedEventArgs e)
 {
     Kbd.ClearState();
 }
Exemplo n.º 3
0
 private void Window_KeyUp(object sender, KeyEventArgs e)
 {
     Kbd.KeyUp(e.Key);
 }