Ejemplo n.º 1
0
Archivo: Level.cs Proyecto: rango84/Run
        public Level(int goalLength,int num)
        {
            vel = new Vector2(((float)Maths.random.NextDouble() - 0.5f), 0);
            people = new List<Person>();
            freewayDistance = Maths.random.Next(7000) + 4000;
            freewayStart = 0;
            number = num;
            seriouslyDone = false;
            Doom = new Thing("DoomWall", new Vector2(-1500 + (ApocalypseParkour.Difficulty * 168), 0), 0);
            Doom.MyAnimationFlyWeight.gotoAnim("Doom",true);
            if (!ApocalypseParkour.leisureMode)
            {
                Doom.Velocity = new Vector2(Player.topSpeed - 4 + (ApocalypseParkour.Difficulty * 1.315f), 0);
            }
            goal = goalLength;
            MissleFired = false;
            height = maxHeight + 100;
            buildings = new List<Building>();
            Clouds = new List<Thing>();
            //Clouds.Add();
            player = new Player("Sean", new Vector2(-10,maxHeight - 100), 0);
            if (ApocalypseParkour.Horde)
            {
                for (int i = 0; i < 100; ++i)
                {
                    AddPerson(new Vector2(0 + Maths.random.Next(500), maxHeight - +Maths.random.Next(50)));
                    people[i].Velocity = new Vector2(1 + Maths.random.Next(7), 1 + Maths.random.Next(7));
                }
            }
            player.Velocity = new Vector2(5, 5);

            buildings.Add(new Building(new Vector2(100, height), 0));
            if (!buildings[buildings.Count - 1].invulnerable)
            {
                progress += (int)buildings[buildings.Count - 1].width * 32;

            }
            else
            {
                progress += globals._Sprites[buildings[buildings.Count - 1].MyAnimationFlyWeight.SpriteName].Width;
            }

            while (progress < goal * Maths.PixelsInAMeter)
            {
                SpawnNewBuidling(false);
            }

            SpawnNewBuidling(true);
            goal = (int)(buildings[buildings.Count - 1].Position.X + 100) / Maths.PixelsInAMeter;
            nextSpawn = 0;
            untilDisaster = Maths.random.Next(10);
            Missle = new LiveThing("Missle",new Vector2(-2000,-2000),0);
            Missle.Velocity = new Vector2(20.0f, 0.0f);
            Ridden = false;
            PlayerDead = false;
            cityscape = new Thing("CityScape", new Vector2(0, maxHeight), 0);
        }
Ejemplo n.º 2
0
 public void Invade()
 {
     if (!invulnerable)
     {
         UFO = new Thing("UFO", new Vector2(position.X + (width * 16) - (globals._Sprites["UFO"].Width / 2), position.Y - 700), 0);
     }
 }