Beispiel #1
0
        private static Canvas CreateSleetScene()
        {
            var container = new Canvas();
            var random    = new Random();

            for (int i = 0; i < 10; i++)
            {
                var x        = random.Next(0, (int)_screenSize.Width);
                var size     = random.Next(4, 20);
                var duration = random.Next(10, 20);
                var delay    = random.Next(0, 10);

                var snow = Icons.CreateSnowBall(x, size, duration, delay, _screenSize);
                container.Children.Add(snow);
            }

            for (int i = 0; i < 10; i++)
            {
                var x        = random.Next(0, (int)_screenSize.Width);
                var duration = random.Next(2, 10);
                var delay    = random.Next(0, 10);

                var line = Icons.CreateLine(x, duration, delay, _screenSize);
                container.Children.Add(line);
            }

            return(container);
        }
Beispiel #2
0
        private static Canvas CreateRainyScene()
        {
            var container = new Canvas();
            var rand      = new Random();

            for (int i = 0; i < 35; i++)
            {
                var x        = rand.Next(0, (int)_screenSize.Width);
                var duration = rand.Next(3, 8);
                var delay    = rand.Next(0, 10);

                var line = Icons.CreateLine(x, duration, delay, _screenSize);
                container.Children.Add(line);
            }

            return(container);
        }