public bool Intersects(PlayerTwo playerTwo)
 {
     if (Player_box.Intersects(new Rectangle((int)playerTwo.Position.X, (int)playerTwo.Position.Y, (int)playerTwo.Size.X, (int)playerTwo.Size.Y)))
     {
         return true;
     }
     return false;
 }
Exemple #2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            int i = 0;
            while (i < 11)
            {
                Portal portal = new Portal(200 * i, 100 * i, graphics);
                portal.portD = random.Next(10, 25);
                portals.Add(portal);
                i++;
            }
            playerOne = new PlayerOne(400, 500, graphics);
            playerTwo = new PlayerTwo(1600, 500, graphics);

            graphics.PreferredBackBufferHeight = 1080;
            graphics.PreferredBackBufferWidth = 1920;
            if (graphics.IsFullScreen)
            {
                graphics.ToggleFullScreen();
            }
        }