Beispiel #1
0
        public void InitializeForest()
        {
            // TODO: agregue aquí su lógica de inicialización

            road = new Road(300, 3, new Vector2(200, 480), "roca", 100);
            car = new Car();
            enemies = new Enemies(35, road);
            fuel = new Fuel(150);
            mapGoal = new MapGoal(300);
            menu = new Menu();
            this.optionInstruction = false;

            base.Initialize();
        }
Beispiel #2
0
        public Enemies(int numEnemies, Road road)
        {
            this.road = road;
            this.numEnemies = numEnemies;

            enemies = new List<Enemy>();
            int offset = -1;
            Random rd = new Random();
            for (int i = 0; i < this.numEnemies; i++)
            {
                //enemies.Add(new Enemy(new Vector2(300, 800*offset),rd.Next(0,1)));
                int n = rd.Next(0, 4);
                //rd = new Random();
                int m = rd.Next(0, 4);
                if (n < 2)
                {
                    if (m < 2)
                    {
                        enemies.Add(new Enemy(new Vector2(300, 300 * offset), 1, 1));
                    }
                    else
                    {
                        enemies.Add(new Enemy(new Vector2(300, 300 * offset), 0, 1));
                    }

                }
                else
                {
                    if (m < 2)
                    {
                        enemies.Add(new Enemy(new Vector2(300, 300 * offset), 1, 0));
                    }
                    else
                    {
                        enemies.Add(new Enemy(new Vector2(300, 300 * offset), 0, 0));
                    }
                }

                offset-=2;
            }
        }