Example #1
0
        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
            gameState = GameState.TitleScreen;
            previousState = gameState;

            upgradeScreen = null;
            startScreen = null;
            characterScreen = null;
            multiplayerLobby = null;
            deathScreen = null;
            levelBeginning = null;
            pauseScreen = null;
            loadingScreen = null;

            levelCreator = null;

            Random rand = new Random();
            currentLevel = null;

            enemies = null;
            explosions = null;
            shotBehavior = null;
            enemyShots = null;
            playerShots = null;
            hbOne = null;
            hbTwo = null;
            bossLifeBar = null;
            cbOne = null;
            cbTwo = null;
            backGroundMusic = null;
            playerOneMeterTitle = null;
            playerTwoMeterTitle = null;
            meterLabel = null;
            playerOneMarker = null;
            playerTwoMarker = null;

            dinosaurOne = null;
            dinosaurTwo = null;
            playerOneSprite = null;
            playerTwoSprite = null;
            collisions = null;
            font = null;

            playerOneCounter = 0;
            playerTwoCounter = 0;
            levelIncrement = 0;

            singlePlayer = false;
            explodedOne = false;
            explodedTwo = false;

            input = null;
            padInput = null;
        }
Example #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()
        {
            gameState = GameState.TitleScreen;

            spriteBatch = new SpriteBatch(GraphicsDevice);

            backGroundMusic = new BackgroundMusic(Content, BackgroundMusic.playAt.Level1);

            startScreen = new StartScreen(graphics, spriteBatch, Content);
            fadeScreen = new FadeScreen(graphics);

            enemies = new List<Sprite>();
            explosions = new List<AnimatedSprite>();

            collisions = new Collisions(Content, explosions);
            input = new KeyboardInput();
            padInput = new GamepadInput();

            hbOne = new HealthBar(Content, graphics, new Vector2(50, graphics.PreferredBackBufferHeight - 125));
            cbOne = new ChargeMeter(Content, graphics, new Vector2(50, graphics.PreferredBackBufferHeight - 75));
            meterLabel = Content.Load<Texture2D>("Images/meter-labels");
            playerOneMeterTitle = Content.Load<Texture2D>("Images/meter-player-one");
            playerTwoMeterTitle = Content.Load<Texture2D>("Images/meter-player-two");
            playerOneMarker = Content.Load<Texture2D>("Images/P1-Marker");
            playerTwoMarker = Content.Load<Texture2D>("Images/P2-Marker");

            bossLifeBar = new HealthBar(Content, graphics, new Vector2(graphics.PreferredBackBufferWidth / 2 - 140, 50));
            bossLifeBar.IsVisible = false;

            font = Content.Load<SpriteFont>("Font");

            levelCreator = new LevelCreator(Content);

            pauseScreen = new PauseScreen(graphics, Content);

            creditScreen = new CreditScreen(graphics, Content);
        }