예제 #1
0
        private static void AddClouds(ForegroundLayer l)
        {
            for(var i = 0; i < 2000;i++)
            {
                var x = rnd.NextDouble() * World.Width;
                var y = rnd.NextDouble() * World.Height;
                var speed = 1f + rnd.NextDouble() * 10f;

                l.GetEntities(true).Add(new EntityCloud(new Vector2((float)x, (float)y), (float)speed));
            }
        }
예제 #2
0
        private static void AddClouds(ForegroundLayer l)
        {
            for (var i = 0; i < 2000; i++)
            {
                var x     = rnd.NextDouble() * World.Width;
                var y     = rnd.NextDouble() * World.Height;
                var speed = 1f + rnd.NextDouble() * 10f;

                l.GetEntities(true).Add(new EntityCloud(new Vector2((float)x, (float)y), (float)speed));
            }
        }
예제 #3
0
        /// <summary>
        /// Generate layers
        /// </summary>
        /// <returns>Generated layers</returns>
        public static List<Layer> Generate()
        {
            rnd = new Random(50);
            List<Layer> layers = new List<Layer>();

            for (int i = 0; i < 3; i++)
            {
                ForegroundLayer l = new ForegroundLayer(0.25f + (i * 0.05f));
                l.Visible = true;
                layers.Add(l);
            }
            Loop(layers);
            AddClouds((ForegroundLayer)layers[0]);
            layers.Add(new BackgroundLayer(0.55f));
            return layers;
        }
예제 #4
0
        /// <summary>
        /// Generate layers
        /// </summary>
        /// <returns>Generated layers</returns>
        public static List <Layer> Generate()
        {
            rnd = new Random(50);
            List <Layer> layers = new List <Layer>();

            for (int i = 0; i < 3; i++)
            {
                ForegroundLayer l = new ForegroundLayer(0.25f + (i * 0.05f));
                l.Visible = true;
                layers.Add(l);
            }
            Loop(layers);
            AddClouds((ForegroundLayer)layers[0]);
            layers.Add(new BackgroundLayer(0.55f));
            return(layers);
        }