public CameralWall(Camera cam, GraphicsDevice gd, CamSide side)
 {
     this.cam = cam;
     this.side = side;
     rightOffset = gd.Viewport.Width;
     boundingBox = new Rectangle(0, 0, 0, gd.Viewport.Height);
 }
 public Spawner(EnemyManager em, Vector2 position, Camera cam, Texture2D tex)
 {
     enemyManager = em;
     count = rand.Next(350)+50;
     this.cam = cam;
     texture = tex;
     boundingBox = new Rectangle((int)position.X, (int)position.Y, texture.Width,texture.Height);
 }
 public WallManager(Camera cam, GraphicsDevice gd)
 {
     walls.Add(new Wall(0, -10, Game1.width, 15));
     walls.Add(new Wall(0, 475, Game1.width, 5));
     walls.Add(new Wall(0, 0, 5, 480));
     walls.Add(new Wall(Game1.width-5, 0, 5, 480));
     walls.Add(new Wall(440, 200, 80, 25));
     camWalls.Add(new CameralWall(cam, gd, CamSide.left));
     camWalls.Add(new CameralWall(cam, gd, CamSide.right));
 }
 public PlayerManager(ContentManager Content, BulletManager bm, Camera cam, int numPlayers)
 {
     players = new Dictionary<PlayerIndex, Player>();
     if (GamePad.GetState(PlayerIndex.One).IsConnected && numPlayers > 0)
     {
         players.Add(PlayerIndex.One, new Player(PlayerIndex.One, Content, bm, players, new Vector2(100, 100)));
     }
     if (GamePad.GetState(PlayerIndex.Two).IsConnected && numPlayers > 1)
     {
         players.Add(PlayerIndex.Two, new Player(PlayerIndex.Two, Content, bm, players, new Vector2(100, 200)));
     }
     if (GamePad.GetState(PlayerIndex.Three).IsConnected && numPlayers > 2)
     {
         players.Add(PlayerIndex.Three, new Player(PlayerIndex.Three, Content, bm, players, new Vector2(200, 100)));
     }
     if (GamePad.GetState(PlayerIndex.Four).IsConnected && numPlayers > 3)
     {
         players.Add(PlayerIndex.Four, new Player(PlayerIndex.Four, Content, bm, players, new Vector2(200, 200)));
     }
     camera = cam;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            cam = new Camera(GraphicsDevice.Viewport.Width / 2, Game1.width - (GraphicsDevice.Viewport.Width / 2));
            cam.Pos = new Vector2(0, GraphicsDevice.Viewport.Height / 2);

            base.Initialize();
        }
Exemplo n.º 6
0
 public UI(Dictionary<PlayerIndex, Player> p, Camera cam)
 {
     players = p;
     camera = cam;
 }