Example #1
0
 internal Wood() : base(2, "Wood")
 {
     // slightly long
     Shape = new ShapeBlocks[, ] {
         { ShapeBlocks.Pivot },
         { ShapeBlocks.Solid }
     };
 }
Example #2
0
        /// <summary>
        /// Get the first out-of-bounds ShapeBlocks, which should be sent to client. Called by host.
        /// </summary>
        public override List <ShapeBlock> GetNextBlocks()
        {
            var nextBlock = ShapeBlocks.FirstOrDefault(x => x.OffsetX >= GameSettings.HorizontalCellCount);

            if (nextBlock is null)
            {
                // Generate blocks for the next screen
                var lastBlock = ShapeBlocks.Last();
                var blocks    = Strategy.GenerateShapeBlocks(lastBlock.OffsetX + 1, lowerBoundY, GameSettings.HorizontalCellCount * 2, upperBoundY, lastBlock.OffsetY + CenterPosY);
                nextBlock = blocks.First();
                ShapeBlocks.AddRange(GenerationStrategy.MakeRelative(blocks, CenterPosX, CenterPosY));
            }
            return(ShapeBlocks.Where(x => x.OffsetX == nextBlock.OffsetX).ToList());
        }
Example #3
0
 /// <summary>
 /// Add a shape block to the end of the static shape. Called by cliend to append generated shape blocks sent by host
 /// </summary>
 /// <param name="shapeBlock"></param>
 public void AddShapeBlocks(List <ShapeBlock> shapeBlocks)
 {
     ShapeBlocks.AddRange(shapeBlocks);
 }
Example #4
0
 /// <summary>
 /// For platforms sliding
 /// platforms CenterPosX is all ways 0
 /// </summary>
 public override void ShiftBlocks()
 {
     ShapeBlocks.ForEach(x => x.OffsetX--);
     ShapeBlocks.RemoveAll(x => x.OffsetX < 0);
 }