/// <summary> /// Create a new level. /// </summary> /// <param name="width">Width of the level in number of blocks.</param> /// <param name="height">Height of the level in number of blocks.</param> public GamePlayManager(int width, int height) { //Set up the starting matrix and set it to all zeroes. levelGrid = new int[width, height]; Array.Clear(levelGrid, 0, levelGrid.Length); //Generate the first block, and set up rotation subsystem. blockFactory = new BlockFactory(); wallKickData = new WallKickData(); activeBlock = blockFactory.GetNewBlock(); activeBlockPosition = spawnPoint; //Generate the next 3 blocks. nextBlocks = new Queue <Block>(); for (int i = 0; i < 3; i++) { nextBlocks.Enqueue(blockFactory.GetNewBlock()); } }
/// <summary> /// Create a new level. /// </summary> /// <param name="width">Width of the level in number of blocks.</param> /// <param name="height">Height of the level in number of blocks.</param> public GamePlayManager(int width, int height) { //Set up the starting matrix and set it to all zeroes. levelGrid = new int[width, height]; Array.Clear(levelGrid, 0, levelGrid.Length); //Generate the first block, and set up rotation subsystem. blockFactory = new BlockFactory(); wallKickData = new WallKickData(); activeBlock = blockFactory.GetNewBlock(); activeBlockPosition = spawnPoint; //Generate the next 3 blocks. nextBlocks = new Queue<Block>(); for (int i = 0; i < 3; i++) { nextBlocks.Enqueue(blockFactory.GetNewBlock()); } }