/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it c5an query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //COMMENT OUT AFTER TESTING TRIAL MODE //Guide.SimulateTrialMode = true; mGraphics.PreferredBackBufferWidth = 1280; mGraphics.PreferredBackBufferHeight = 720; //mGraphics.ToggleFullScreen();// REMEMBER TO RESET AFTER DEBUGGING!!!!!!!!! mGraphics.ApplyChanges(); mTitle = new Title(mControls, mGraphics); mMainMenu = new MainMenu(mControls, mGraphics); //mMenu = new Menu(mControls, mGraphics); mScoring = new Scoring(mControls); mWorldSelect = new WorldSelect(mControls, mGraphics); mPause = new Pause(mControls); mCredits = new Credits(mControls, mGraphics); mOptions = new Options(mControls, mGraphics); mAfterScore = new AfterScore(mControls); mResetConfirm = new ResetConfirm(mControls); mStartLevelSplash = new StartLevelSplash(mControls); mController = new Controller(mControls, mGraphics); mSoundOptions = new SoundOptions(mControls, mGraphics); mSpriteBatch = new SpriteBatch(mGraphics.GraphicsDevice); base.Initialize(); Components.Add(new GamerServicesComponent(this)); }
/* * Update * * Updates the menu depending on what the user has selected. * It will handle the title, options, load and all other menu * screens * * GameTime gameTime: The current game time variable */ public void Update(GameTime gameTime, ref GameStates gameState, ref Level level, WorldSelect worldSelect) { if (mControls.isStartPressed(false) || mControls.isAPressed(false)) { gameState = GameStates.AfterScore; //#if XBOX360 // mSelect.Save(((ControllerControl)mControls).ControllerIndex); //#else // mSelect.Save(PlayerIndex.One); //#endif } }
/* * Load * * Similar to a loadContent function. This function loads and * initializes the variable and art used in the class. * * ContentManager content: the Content file used in the game. */ public void Load(ContentManager content, GraphicsDevice graphics, WorldSelect worldSelect) { mContent = content; mScreenRect = graphics.Viewport.TitleSafeArea; // mCurrentLevel = new LevelInfo(); current = mScreenRect.Right; mTrans = content.Load<Texture2D>("Images/Menu/Pause/PausedTrans"); mQuartz = content.Load<SpriteFont>("Fonts/QuartzEvenLarger"); xCoord = mScreenRect.Center.X - mQuartz.MeasureString("COMPLETED GEM CHALLENGE").X / 2; centerYCoord = mScreenRect.Center.Y - mQuartz.MeasureString("COMPLETED TIME CHALLENGE").Y / 2; topYCoord2 = mScreenRect.Center.Y - mQuartz.MeasureString("COMPLETED TIME CHALLENGE").Y; bottomYCoord2 = mScreenRect.Center.Y + mQuartz.MeasureString("COMPLETED TIME CHALLENGE").Y; topYCoord3 = mScreenRect.Center.Y - mQuartz.MeasureString("COMPLETED GEM CHALLENGE").Y * 2; bottomYCoord3 = mScreenRect.Center.Y + mQuartz.MeasureString("COMPLETED DEATH CHALLENGE").Y; mScale = 1.0f; pulse = false; upToScale = false; gemString = "COMPLETED GEM CHALLENGE!"; timeString = "COMPLETED TIME CHALLENGE!"; deathString = "COMPLETED DEATH CHALLENGE!"; mDoOnce = false; starList = new List<string>(); starList.Clear(); mWorldSelect = worldSelect; }
/* * Load * * Similar to a loadContent function. This function loads and * initializes the variable and art used in the class. * * ContentManager content: the Content file used in the game. */ public void Load(ContentManager content, GraphicsDevice graphics, WorldSelect worldSelect) { mWorldSelect = worldSelect; mContent = content; mKootenay = content.Load<SpriteFont>("Fonts/Kootenay"); mQuartz = content.Load<SpriteFont>("Fonts/QuartzLarge"); mScreenRect = graphics.Viewport.TitleSafeArea; mTitle = content.Load<Texture2D>("Images/Menu/Mr_Gravity"); mBackground = content.Load<Texture2D>("Images/Menu/backgroundSquares1"); mStar = content.Load<Texture2D>("Images/AnimatedSprites/YellowStar"); }