Exemple #1
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 our viewports
            gameViewport  = GraphicsDevice.Viewport;
            worldViewport = new Viewport(0, 0, 768, 720);   // Twice as wide as 16 tiles
            guiViewport   = new Viewport(768, 0, 512, 720); // Remaining space

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            GameObjectManager = new GameObjectManager(Content);

            // TODO: use this.Content to load your game content here
            Player = GameObjectManager.CreatePlayerShip(PlayerShipType.Shrike, new Vector2(300, 300));
            GameObjectManager.CreatePowerup(PowerupType.Fireball, new Vector2(100, 200));

            LevelManager.LoadContent();
            LevelManager.LoadLevel("LavaLevel2");
            GuiManager.LoadContent();
            GameState = GameState.Initializing;
        }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create our viewports
            gameViewport  = GraphicsDevice.Viewport;
            worldViewport = new Viewport(0, 0, 768, 720);   // Twice as wide as 16 tiles
            guiViewport   = new Viewport(768, 0, 512, 720); // Remaining space

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Create a basic effect, used with the spritebatch
            basicEffect = new BasicEffect(GraphicsDevice)
            {
                TextureEnabled     = true,
                VertexColorEnabled = true,
            };

            GameObjectManager = new GameObjectManager(Content);

            // TODO: use this.Content to load your game content here
            Player = GameObjectManager.CreatePlayerShip(PlayerShipType.Shrike, new Vector2(300, 300));
            //Player.ApplyPowerup(PowerupType.Fireball);

            LevelManager.LoadContent();
            LevelManager.LoadLevel("lavaLevel2");
            //test out new panzer personality
            int p1 = 100;
            int p2 = 200;

            for (int i = 0; i < 6; i++)
            {
                GameObjectManager.CreateEnemy(EnemyType.Panzer, new Vector2(p1, 100));
                GameObjectManager.CreateEnemy(EnemyType.Panzer2, new Vector2(p2, 100));
                p1 += 100;
                p2 += 100;
            }
            //test out lavabug
            GameObjectManager.CreateEnemy(EnemyType.Lavabug, new Vector2(100, 75));
        }