private void IncreaseLevel()
        {
            Console.WriteLine("LEVEL: " + Levels);

            int X2 = r.Next(200, 980);
            int Y2 = r.Next(200, 600);

            if (!ChargeExists())
            {
                Shape2D Charge = new Shape2D(new Vector2d(X2, Y2), new Vector2d(10, 10), Color.Green, TypeSpec.Charge);
                shapeHandler.addShape(Charge);
            }

            if (Levels <= 10)
            {
                for (int i = 0; i < Levels; i++)
                {
                    Spawn(Color.White);
                }
            }
            else if (Levels >= 11 && Levels <= 20)
            {
                for (int i = 0; i < Levels; i++)
                {
                    Spawn(Color.Red);
                }
            }
            else if (Levels >= 21 && Levels <= 30)
            {
                for (int i = 0; i < Levels; i++)
                {
                    Spawn(Color.Purple);
                }
            }
            else if (Levels >= 31 && Levels <= 40)
            {
                for (int i = 0; i < Levels; i++)
                {
                    Spawn(Color.AliceBlue);
                }
            }
            else
            {
                for (int i = 0; i < Levels; i++)
                {
                    Spawn(Color.DimGray);
                }
            }
        }
Beispiel #2
0
        public override void OnLoad(ShapeHandler shapeHandler, Vector2d dimensions, Window window, LevelHandler levelHandler, Sound Sound, Player player)
        {
            this.shapeHandler = shapeHandler;
            this.levelHandler = levelHandler;

            shapeHandler.addShape(player.Shape);

            new WorldBuilder(shapeHandler, dimensions);
            input = new Input(playerShape, window, shapeHandler, Sound, player, levelHandler);

            Sound.Play();
        }
        private void Generate()
        {
            for (int i = 0; i < World.GetLength(0); i++)
            {
                for (int j = 0; j < World.GetLength(1); j++)
                {
                    if (World[i, j] == "b")
                    {
                        colors.Add(Color.FromArgb(100 + i, 10 + j, 0));

                        shapeHandler.addShape(new Shape2D(new Vector2d(i * 181, j * 100), new Vector2d(181, 100), Color.LightGreen, TypeSpec.boundries));
                    }
                    if (World[i, j] == "w")
                    {
                        shapeHandler.addShape(new Shape2D(new Vector2d(i * 181, j * 100), new Vector2d(181, 100), Color.Bisque, TypeSpec.Walls));
                    }
                    if (World[i, j] == "r")
                    {
                        shapeHandler.addShape(new Shape2D(new Vector2d(i * 181, j * 100), new Vector2d(181, 100), Color.Black, TypeSpec.Roof));
                    }
                }
            }
        }