示例#1
0
 public override void Update()
 {
     spawnTimer++;
     if (spawnTimer > spawnTime)
     {
         spawnTimer = 0;
         if (EntityManager.TooManyEntitiesInExistence())
         {
             return;
         }
         Vector2 spawnOrientation = new Vector2(r.Next((int)xSpawnRange.X, (int)xSpawnRange.Y), r.Next((int)ySpawnRange.X, (int)ySpawnRange.Y));
         if (canSpawnBoxes)
         {
             currInteractable = new Interactable(world, Position + new Vector2(spawnOrientation.X));
             EntityManager.Add(currInteractable);
             return;
         }
         currDrifter = new Drifter(world, Position)
         {
             driftDirection = spawnOrientation
         };
         EntityManager.Add(currDrifter);
     }
 }
示例#2
0
        public static void SetUpBonusLevel2()
        {
            LevelManager.BonusLevelTime = 25000;
            LevelManager.IsBonusLevel   = true;

            //Set Up World
            TurnOffCameraMovement();
            canXCameraMove          = true;
            world.Gravity           = new Vector2(0, 110);
            willTeleportIfOffscreen = !canXCameraMove;


            //Set Ground
            Vector2 ground_position = new Vector2(graphics.PreferredBackBufferHeight * -.1f, graphics.PreferredBackBufferHeight * .87f);


            //Set Screen Bounds;
            screenBoundRight = graphics.PreferredBackBufferWidth;

            //Add Geometry
            EntityManager.Add(new Floor(world, Art.Ground, new Vector2(0, 0 - Art.Ground.Height), 0));
            EntityManager.Add(new Hitbox(world, new Vector2(596.25f, 328.75f), new Vector2(65, 20)));
            EntityManager.Add(new Hitbox(world, new Vector2(525f, 185f), new Vector2(19, 73)));
            EntityManager.Add(new Hitbox(world, new Vector2(648.75f, 130f), new Vector2(19, 73)));
            EntityManager.Add(new Hitbox(world, new Vector2(726.25f, 301.25f), new Vector2(19, 104)));
            EntityManager.Add(new Hitbox(world, new Vector2(817.5f, 297.5f), new Vector2(19, 107)));
            EntityManager.Add(new Hitbox(world, new Vector2(955f, 323.75f), new Vector2(74, 21)));
            EntityManager.Add(new Hitbox(world, new Vector2(1032.5f, 183.75f), new Vector2(20, 73)));
            EntityManager.Add(new Hitbox(world, new Vector2(897.5f, 130f), new Vector2(18, 73)));

            EntityManager.Add(new Hitbox(world, new Vector2(185f, 298.75f), new Vector2(150, 100)));
            EntityManager.Add(new Hitbox(world, new Vector2(315f, 378.75f), new Vector2(78, 118)));
            EntityManager.Add(new Hitbox(world, new Vector2(740f, 403.75f), new Vector2(851, 29)));
            EntityManager.Add(new Hitbox(world, new Vector2(620.25f, -22.50019f), new Vector2(1090, 37)));
            EntityManager.Add(new Hitbox(world, new Vector2(781.25f, 27.49989f), new Vector2(621, 37)));

            //Walls
            EntityManager.Add(new Wall(world, new Vector2(75f, 120f), 34, 242));
            EntityManager.Add(new Wall(world, new Vector2(1200f, 201.25f), 35, 367));



            //Add BG
            BackgroundManager.SetBG(Art.BG10, new Vector2(1f, 1f));
            EntityManager.Add(new BonusText(world, new Vector2(GameRoot.ScreenSize.X * .75f, GameRoot.ScreenSize.Y * .25f)));



            //Add Players And Enemies
            Player1 = new Player(world, new Vector2(728, 190));
            EntityManager.Add(Player1);
            //192 210
            Drifter currDrifter;

            currDrifter = new Drifter(world, new Vector2(192, 210))
            {
                driftDirection = new Vector2(0, 0)
            };
            EntityManager.Add(currDrifter);

            currDrifter = new Drifter(world, new Vector2(420, 310))
            {
                driftDirection = new Vector2(0, 0)
            };
            EntityManager.Add(currDrifter);

            currDrifter = new Drifter(world, new Vector2(765, 220))
            {
                driftDirection = new Vector2(0, 0)
            };
            EntityManager.Add(currDrifter);
            currDrifter = new Drifter(world, new Vector2(955, 275))
            {
                driftDirection = new Vector2(0, 0)
            };
            EntityManager.Add(currDrifter);
            // drifter = new Drifter(world, new Vector2(240, 210));
            // drifter.driftDirection = new Vector2(0, 0);
            //  EntityManager.Add(drifter);

            // EntityManager.Add(debugBox);
        }