public void loadPauseData() { // Development Version 1.0.2 // Load Textures and Data for Pause Button, Pause Screen and Gameover Screen // Requirement 5.4.0 and 5.5.0 pauseBttnImg = Content.Load<Texture2D>("Buttons/PauseButton"); playBttnImg = Content.Load<Texture2D>("Buttons/PlayButton"); pausedTitle = Content.Load<Texture2D>("PausedScreen/PausedTitle"); pausedQuit = Content.Load<Texture2D>("PausedScreen/PausedQuit"); pausedResume = Content.Load<Texture2D>("PausedScreen/PausedResume"); pausedSelector = Content.Load<Texture2D>("PausedScreen/PausedSelector"); gameOverTitle = Content.Load<Texture2D>("GameOverScreen/GameOverTitle"); gameOverReplay = Content.Load<Texture2D>("GameOverScreen/GameOverReplay"); //create buttons for pausing/game over // Development Version 1.0.2 // Set Pause and Quit Buttons to the Appropriate Graphic, Size and position // Requirement 13.1.0 /*set button graphics*/ pauseBtn = new mButton(pauseBttnImg, graphics.GraphicsDevice); pausedTitleBtn = new mButton(pausedTitle, graphics.GraphicsDevice); pausedQuitBtn = new mButton(pausedQuit, graphics.GraphicsDevice); pausedResumeBtn = new mButton(pausedResume, graphics.GraphicsDevice); gameOverTitleBtn = new mButton(gameOverTitle, graphics.GraphicsDevice); gameOverReplayBtn = new mButton(gameOverReplay, graphics.GraphicsDevice); /*set button sizes*/ pauseBtn.setSize(new Vector2(pauseBttnImg.Width / 2, pauseBttnImg.Height / 2)); pausedTitleBtn.setSize(new Vector2(pausedTitle.Width, pausedTitle.Height)); pausedQuitBtn.setSize(new Vector2(pausedQuit.Width, pausedQuit.Height)); pausedResumeBtn.setSize(new Vector2(pausedResume.Width, pausedResume.Height)); gameOverTitleBtn.setSize(new Vector2(gameOverTitle.Width, gameOverTitle.Height)); gameOverReplayBtn.setSize(new Vector2(gameOverReplay.Width, gameOverReplay.Height)); /*set button positions*/ pauseBtn.setPosition(new Vector2(730, 10)); pausedTitleBtn.setPosition(new Vector2(330, 150)); pausedQuitBtn.setPosition(new Vector2(450, 220)); pausedResumeBtn.setPosition(new Vector2(300, 220)); gameOverTitleBtn.setPosition(new Vector2(310, 150)); gameOverReplayBtn.setPosition(new Vector2(300, 220)); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Development Version 1.0.3 // Create a new SpriteBatch for Drawing All Textures and a Font for Highscores // Requirements 4.3.7, 10.2.6, 11.1.0 and 13.3.0 spriteBatch = new SpriteBatch(GraphicsDevice); font = Content.Load<SpriteFont>("HighscoresFont"); // Development Version 1.0.3 // Set Preferred Screen Ratio/Size // Requirement 4.0.0 graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; graphics.ApplyChanges(); //commit above screen changes IsMouseVisible = true; //set mouse visible // Development Version 2.0.0 // Load Menu Content // Requirements 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4 and 4.3.6 loadMainMenu(); loadHighScoreMenu(); loadHelpMenu(); loadCustomizeMenu(); backButton = new mButton(Content.Load<Texture2D>("Buttons/BackButton"), graphics.GraphicsDevice); backButton.setSize(new Vector2(54, 24)); //image size is 54x24 pixels, size is halved backButton.setPosition(new Vector2(25, 25)); // Development Version 2.0.4 // Add Menu Selection and Zombie Sound Effects to Menus // Requirements 7.6.0, 7.6.1 and 7.6.2 menuSelection = Content.Load<SoundEffect>("Sound/Selection"); zombieSelection = Content.Load<SoundEffect>("Sound/ZombieSound1"); // Development Version 3.0.2 // Create Level System // Requirement 5.8.0 levelSystem = new Level(graphics, Services, spriteBatch, this); }
//load the customize menu objects public void loadCustomizeMenu() { // Development Version 2.0.2 // Set Customize Menu Background // Requirement 4.3.8 custSong = Content.Load<Song>("Sound/CustomizeMusic"); // Development 2.0.2 // Create Customized Menu Buttons and Set Their Size and Position // Requirement 4.3.11 redButton = new mButton(Content.Load<Texture2D>("CustomizeScreen/RunRedThumb"), graphics.GraphicsDevice); greenButton = new mButton(Content.Load<Texture2D>("CustomizeScreen/RunGreenThumb"), graphics.GraphicsDevice); orangeButton = new mButton(Content.Load<Texture2D>("CustomizeScreen/RunOrangeThumb"), graphics.GraphicsDevice); pinkButton = new mButton(Content.Load<Texture2D>("CustomizeScreen/RunPinkThumb"), graphics.GraphicsDevice); blueButton = new mButton(Content.Load<Texture2D>("CustomizeScreen/RunBlueThumb"), graphics.GraphicsDevice); purpleButton = new mButton(Content.Load<Texture2D>("CustomizeScreen/RunPurpleThumb"), graphics.GraphicsDevice); zombieButton = new mButton(Content.Load<Texture2D>("CustomizeScreen/RunZombieThumb"), graphics.GraphicsDevice); // Set size of customize menu buttons (approximate background destionation box sizes) redButton.setSize(new Vector2(200, 200)); greenButton.setSize(new Vector2(100, 100)); orangeButton.setSize(new Vector2(100, 100)); pinkButton.setSize(new Vector2(100, 100)); blueButton.setSize(new Vector2(100, 100)); purpleButton.setSize(new Vector2(100, 100)); zombieButton.setSize(new Vector2(100, 100)); // Set position of customize menu buttons (background destination box locations) redButton.setPosition(new Vector2(300, 158)); greenButton.setPosition(new Vector2(95, 125)); orangeButton.setPosition(new Vector2(20, 280)); pinkButton.setPosition(new Vector2(170, 280)); blueButton.setPosition(new Vector2(605, 125)); purpleButton.setPosition(new Vector2(530, 280)); zombieButton.setPosition(new Vector2(678, 280)); // Development 2.0.2 // Create Selection Underline for Customize Screen and Default Choice to Red // Requirements 1.4.1 and 4.3.10 underline = new Rectangle(327, 405, 150, 3); }
//load the main menu objects public void loadMainMenu() { // Development Version 2.0.1 // Set Main Menu Background // Requirement 4.3.8 mainMenuBG = Content.Load<Texture2D>("TitleScreen/TitleBackground"); // Development 2.0.1 // Create Main Menu Buttons and Set Their Size and Position // Requirements 4.3.1, 4.3.2, 4.3.3, 4.3.4 and 4.3.5 playButton = new mButton(Content.Load<Texture2D>("TitleScreen/TitlePlay"), graphics.GraphicsDevice); highScoreButton = new mButton(Content.Load<Texture2D>("TitleScreen/TitleHighscores"), graphics.GraphicsDevice); helpButton = new mButton(Content.Load<Texture2D>("TitleScreen/TitleHelp"), graphics.GraphicsDevice); customizeButton = new mButton(Content.Load<Texture2D>("TitleScreen/TitleCustomize"), graphics.GraphicsDevice); soundButton = new mButton(Content.Load<Texture2D>("Buttons/SoundButton"), graphics.GraphicsDevice); // Set size of main menu buttons playButton.setSize(new Vector2(71, 39)); // Image size is 71x39 pixels highScoreButton.setSize(new Vector2(177, 42)); // image size is 177x42 pixels helpButton.setSize(new Vector2(64, 39)); // Image size is 64x39 pixels customizeButton.setSize(new Vector2(165, 32)); // Image size is 165x32 pixels soundButton.setSize(new Vector2(115 / 2, 119 / 2)); // Image size is 115x119 pixels, size is halved // Set position of main menu buttons playButton.setPosition(new Vector2(screenWidth / 2 - playButton.size.X / 2, (screenHeight / 5) + 5)); highScoreButton.setPosition(new Vector2(screenWidth / 2 - highScoreButton.size.X / 2, (screenHeight / 5) + 65)); helpButton.setPosition(new Vector2(screenWidth / 2 - helpButton.size.X / 2, (screenHeight / 5) + 125)); customizeButton.setPosition(new Vector2(screenWidth / 2 - customizeButton.size.X / 2, (screenHeight / 5) + 185)); soundButton.setPosition(new Vector2(screenWidth - soundButton.size.X - 25, 25)); // Development Version 2.0.4 // Main Menu Music // Requirement 7.1.0 titleSong = Content.Load<Song>("Sound/TitleMusic"); }