public static void setState(int state, int prevState) { if (prevState == 1) { //do nothing } else { MusicPlayer.SwitchSong(state, level); } if (state == 1) { mCurrentState = GameState.Title; currentGameState = 1; } else if (state == 2) { mCurrentState = GameState.Hall; currentGameState = 2; } else if (state == 3) { mCurrentState = GameState.Options; currentGameState = 3; } else if (state == 4) { mCurrentState = GameState.Playing; currentGameState = 4; } else if (state == 5) { mCurrentState = GameState.Sounds; currentGameState = 5; } else if (state == 6) { mCurrentState = GameState.Controls; currentGameState = 6; } else if (state == 7) { mCurrentState = GameState.Pause; currentGameState = 7; } else if (state == 8) { mCurrentState = GameState.Pong; currentGameState = 8; } else if (state == 9) { mCurrentState = GameState.Frogger; currentGameState = 9; } else if (state == 10) { mCurrentState = GameState.MiniGames; currentGameState = 10; } else if (state == 11) { mCurrentState = GameState.Graphics; currentGameState = 11; } else if (state == 12) { mCurrentState = GameState.Show; currentGameState = 12; } else { mCurrentState = GameState.Difficulty; currentGameState = 13; } }
protected override void LoadContent() { //Load Content for all of the different screens titleScreen.LoadContent(Content); hallOfFame.LoadContent(Content); optScn.LoadContent(Content); control.LoadContent(Content); sound.LoadContent(Content); pause.LoadContent(Content); game.LoadContent(Content); MusicPlayer.LoadContent(Content); enemies.LoadContent(Content); frog.LoadContent(Content); grph.LoadContent(Content); mini.LoadContent(Content); difficult.LoadContent(Content); show.LoadContent(Content); //sound effects arrowSound = Content.Load <SoundEffect>("Sounds/sound"); arrowSelect = Content.Load <SoundEffect>("Sounds/select"); arrowBack = Content.Load <SoundEffect>("Sounds/goBack"); //creating each sound instance and setting the volumes arrowSoundInstance = arrowSound.CreateInstance(); arrowSoundInstance.Volume = volume; arrowSelectInstance = arrowSelect.CreateInstance(); arrowSelectInstance.Volume = volume; arrowBackInstance = arrowBack.CreateInstance(); arrowBackInstance.Volume = volume; spriteBatch = new SpriteBatch(GraphicsDevice); //load all of the graphics needed for in game viewButtons = Content.Load <Texture2D>("Images/Menus/buttonsInverted"); tileTexture1 = Content.Load <Texture2D>("Images/Objects/block"); pong = Content.Load <Texture2D>("Images/Objects/Pong"); tileTexture2 = Content.Load <Texture2D>("Images/Objects/mblock"); blockTexture = Content.Load <Texture2D>("Images/Objects/mario block"); platformTexture = Content.Load <Texture2D>("Images/Objects/Platform"); megamanTexture = Content.Load <Texture2D>("Images/MegaManRun"); spikesUpTexture = Content.Load <Texture2D>("Images/Objects/Spikes Up"); spikesDownTexture = Content.Load <Texture2D>("Images/Objects/Spikes Down"); spikesLeftTexture = Content.Load <Texture2D>("Images/Objects/Spikes Left"); spikesRightTexture = Content.Load <Texture2D>("Images/Objects/Spikes Right"); quarterTexture = Content.Load <Texture2D>("Images/Objects/quarter"); bowser = Content.Load <Texture2D>("Images/bowser2"); bowserText = Content.Load <Texture2D>("Images/bowserText"); bowserText2 = Content.Load <Texture2D>("Images/bowserText2"); ui = Content.Load <Texture2D>("Images/UI Overlay"); //Load fonts for game hudFont = Content.Load <SpriteFont>("Fonts/Hud"); debugFont = Content.Load <SpriteFont>("debugFont"); //create the players character megaman = new AnimatedSprite(megamanTexture, 0, 60, 50); //create the levels board1 = new Board(1, spriteBatch, tileTexture1, blockTexture, platformTexture, spikesUpTexture, spikesDownTexture, spikesLeftTexture, spikesRightTexture, quarterTexture, 212, 20); board2 = new Board(2, spriteBatch, tileTexture2, blockTexture, platformTexture, spikesUpTexture, spikesDownTexture, spikesLeftTexture, spikesRightTexture, quarterTexture, 212, 20); //Set where player starts megaman.Position = new Vector2(100, 655); //Create players bullets LiveProjectiles = new List <Projectiles>(); Bullet = Content.Load <Texture2D>("Images/Objects/bullet"); prison1 = Content.Load <Texture2D>("Images/Backgrounds/PrisonBackground1"); prison2 = Content.Load <Texture2D>("Images/Backgrounds/PrisonBackground2"); prison3 = Content.Load <Texture2D>("Images/Backgrounds/PrisonBackground3"); prisonBoss = Content.Load <Texture2D>("Images/Backgrounds/PrisonBoss"); stairs = Content.Load <Texture2D>("Images/Objects/stairs"); mb1 = Content.Load <Texture2D>("Images/Backgrounds/mb1"); mb2 = Content.Load <Texture2D>("Images/Backgrounds/mb2"); mb3 = Content.Load <Texture2D>("Images/Backgrounds/mb3"); mb4 = Content.Load <Texture2D>("Images/Backgrounds/mboss"); black = Content.Load <Texture2D>("Images/Backgrounds/background"); //Set background for level if (level == 1) { Board.CurrentBoard = board1; } if (level == 2) { Board.CurrentBoard = board2; } }