Exemplo n.º 1
0
        /// <summary>
        /// A block (tetromino) that falls down the grid
        /// </summary>
        /// <param name="positionSpawner">The position spawner to determine which block it should be</param>
        public Block(BlockPositionSpawner positionSpawner)
        {
            // decide which block it is
            Random             random   = new Random();
            BlockStartPosition startPos = positionSpawner.Next();

            squares = startPos.position;
            color   = startPos.color;

            // set the initial position
            x = 3;
            y = 0;
        }
Exemplo n.º 2
0
 /// <summary>
 /// A spawner which will create the next blocks to be played
 /// </summary>
 public BlockSpawner(String blockSet)
 {
     positionSpawner = new BlockPositionSpawner(blockSet);
 }