Ejemplo n.º 1
0
    private void MoveDown()
    {
        if (gameTimer.IsPaused)
        {
            gameTimer.Start();
        }

        Console.WriteLine("Moving down");

        if (_CollisionTester.MoveShape(Direction.Down) && !_CollisionTester.CheckOverlaps())
        {
            _CurrentShape.MoveShape(Direction.Down);
        }
        else
        {
            _CollisionTester.MoveShape(Direction.Up);
            _CurrentShape.AssignToGrid();
            TetrisGrid.ClearLines();
            _CurrentShape    = ChooseNewShape();
            _CollisionTester = _CurrentShape.Clone();
            _CurrentShape.GenerateShape();
            _CollisionTester.GenerateShape();
        }
    }