Ejemplo n.º 1
0
 public static void CheckPlayerItemCollisions(Player player)
 {
     foreach (Item i in _items)
     {
         if (i.Collides(player))
         {
             player.ItemCollision(i);
         }
     }
 }
Ejemplo n.º 2
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()
        {
            screenHeight = GraphicsDevice.Viewport.Height;
            screenWidth = GraphicsDevice.Viewport.Width;

            _playerOne = new Player(PlayerIndex.One);
            _playerOne.InitializeControls();

            _gameState = GameState.Playing;

            ItemManager.Initialize(2);

            base.Initialize();
        }