internal void InitializeNewGame() { fallingBlock = FallingBlockGenerator.Generate(RandomEnumGenerator.Generate <BlocksShape>(), new Point(this.GameplayManager.Columns / 2 - 1, -3)); // The following line is use for debug. //fallingBlock = new FallingBlockI(new Point(0, 0), BlockColor.Black); MergeBlock = new MergeBlocks(); }
public TetrisGame() { TextureManager = new TextureManager(); WindowManager = new WindowManager(); GameplayManager = new GameplayManager(); InputManager = new InputManager(); fallingBlock = new FallingBlock(); MergeBlock = new MergeBlocks(); }
public bool RightSideIsFree(MergeBlocks mergeBlocks) { var obstaclesInTheRightSide = from block1 in List join block2 in mergeBlocks.List on(int) block1.Location.Y equals(int) block2.Location.Y where (int)(block1.Location.X + 1) == (int)block2.Location.X select block2; return(obstaclesInTheRightSide.Count() == 0); }