public Game(Window gameWindow) { FillBagOfPieces(); _CurrentShape = ChooseNewShape(); _CollisionTester = _CurrentShape.Clone(); gameTimer = SplashKit.CreateTimer("gameTicks"); gameTimer.Start(); gameTimer.Pause(); }
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(); } }