public static void Initialize(ContentManager content, Player player, EnemyManager enemyManager)
        {
            thePlayer = player;
            theEnemyManager = enemyManager;

            spriteSheet = content.Load<Texture2D>(@"Sprites\SpriteSheet");
        }
Exemplo n.º 2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            spriteSheet = Content.Load<Texture2D>(@"Sprites\SpriteSheet");

            // Setup player sprite
            player = new Player(spriteSheet, new Rectangle(0, 0, GameConstants.HERO_WIDTH, GameConstants.HERO_HEIGHT), 4,
                new Rectangle(0, 0, this.Window.ClientBounds.Width, this.Window.ClientBounds.Height));
            enemyManager = new EnemyManager(spriteSheet, new Rectangle(GameConstants.GLOB_LOC_X,
                GameConstants.GLOB_LOC_Y, GameConstants.GLOB_WIDTH, GameConstants.GLOB_HEIGHT),
                4, new Rectangle(0, 0, GameConstants.SCREEN_WIDTH, GameConstants.SCREEN_HEIGHT));

            LevelManager.Initialize(Content, player, enemyManager);
            HUD.Initialize(Content);
        }