Ejemplo n.º 1
0
        public Section CreateSafeLevelBlock()
        {
            var safeBackground = GetBackgroundEntity(BgKeys.bg_a00);
            var levelBlock     = new Section();

            levelBlock.AddBackgroundEntity(safeBackground.Entity);
            return(levelBlock);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Factory method to create Section from a given BackgroundEntity
        /// </summary>
        /// <param name="backgroundEnt"></param>
        /// <returns></returns>
        private Section CreateLevelBlock(BackgroundEntity backgroundEnt)
        {
            var levelBlock = new Section();

            levelBlock.AddBackgroundEntity(backgroundEnt.Entity).AddHoleRange(backgroundEnt.Holes);

            var len = levelBlock.Length;

            RandomAddObstacles(levelBlock, len, backgroundEnt.MaxNbObstacles);

            return(levelBlock);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Factory method to create Section from a given BackgroundEntity
        /// </summary>
        /// <param name="backgroundEnt"></param>
        /// <param name="maxObstacleOverride">The maximum number of obstacle in the block level</param>
        /// <returns></returns>
        private Section CreateLevelBlock(Entity backgroundEnt, int? maxObstacleOverride = null)
        {
            // Reset position
            backgroundEnt.Transform.Position = Vector3.Zero;

            var levelBlock = new Section();
            var backgroundInfo = backgroundEnt.Get<BackgroundInfo>();
            levelBlock.AddBackgroundEntity(backgroundEnt).AddHoleRange(backgroundInfo.Holes);

            var len = levelBlock.Length;
            RandomAddObstacles(levelBlock, len, maxObstacleOverride ?? backgroundInfo.MaxNbObstacles);

            return levelBlock;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Factory method to create Section from a given BackgroundEntity
        /// </summary>
        /// <param name="backgroundEnt"></param>
        /// <param name="maxObstacleOverride">The maximum number of obstacle in the block level</param>
        /// <returns></returns>
        private Section CreateLevelBlock(Entity backgroundEnt, int?maxObstacleOverride = null)
        {
            // Reset position
            backgroundEnt.Transform.Position = Vector3.Zero;

            var levelBlock     = new Section();
            var backgroundInfo = backgroundEnt.Get(ScriptComponent.Key).Scripts.OfType <BackgroundInfo>().First();

            levelBlock.AddBackgroundEntity(backgroundEnt).AddHoleRange(backgroundInfo.Holes);

            var len = levelBlock.Length;

            RandomAddObstacles(levelBlock, len, maxObstacleOverride ?? backgroundInfo.MaxNbObstacles);

            return(levelBlock);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Factory method to create Section from a given BackgroundEntity
        /// </summary>
        /// <param name="backgroundEnt"></param>
        /// <returns></returns>
        private Section CreateLevelBlock(BackgroundEntity backgroundEnt)
        {
            var levelBlock = new Section();

            levelBlock.AddBackgroundEntity(backgroundEnt.Entity).AddHoleRange(backgroundEnt.Holes);

            var len = levelBlock.Length;
            RandomAddObstacles(levelBlock, len, backgroundEnt.MaxNbObstacles);

            return levelBlock;
        }
Ejemplo n.º 6
0
 public Section CreateSafeLevelBlock()
 {
     var safeBackground = GetBackgroundEntity(BgKeys.bg_a00);
     var levelBlock = new Section();
     levelBlock.AddBackgroundEntity(safeBackground.Entity);
     return levelBlock;
 }