/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here Shared.Stage = new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); // instantiate all scenes startScene = new StartScene(this, spriteBatch); this.Components.Add(startScene); actionScene = new ActionScene(this, spriteBatch); this.Components.Add(actionScene); helpScene = new HelpScene(this, spriteBatch); this.Components.Add(helpScene); highScoreScene = new HighScoreScene(this, spriteBatch); this.Components.Add(highScoreScene); aboutScene = new AboutScene(this, spriteBatch); this.Components.Add(aboutScene); gameOverScene = new GameOverScene(this, spriteBatch); this.Components.Add(gameOverScene); // show start scene startScene.Show(); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here Texture2D startTex = this.Content.Load <Texture2D>("Images/startScene"); font = this.Content.Load <SpriteFont>("Fonts/titleFont"); regularFont = this.Content.Load <SpriteFont>("Fonts/regularFont"); //Code to add the scenes startScene = new StartScene(this, startTex); this.Components.Add(startScene); actionScene = new ActionScene(this); this.Components.Add(actionScene); creditScene = new CreditScene(this); this.Components.Add(creditScene); helpScene = new HelpScene(this); this.Components.Add(helpScene); endGameScene = new EndGameScene(this, font); this.Components.Add(endGameScene); howToPlay = new HowToPlayScene(this); this.Components.Add(howToPlay); highScoreScene = new HighScoreScene(this, regularFont); this.Components.Add(highScoreScene); startScene.Show(); song = this.Content.Load <Song>("Sounds/soundTrack"); MediaPlayer.Play(song); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); _resources = new Resources(this); // Add startScene startScene = new StartScene(this, spriteBatch); Components.Add(startScene); startScene.Show(true); // Add playScene playScene = new GameScene(this, spriteBatch); Components.Add(playScene); playScene.Show(false); // Add creditsScene creditsScene = new CreditsScene(this, spriteBatch); Components.Add(creditsScene); creditsScene.Show(false); // Add helpScene helpScene = new HelpScene(this, spriteBatch); Components.Add(helpScene); helpScene.Show(false); // Add highScoreScene highScoreScene = new HighScoreScene(this, spriteBatch); Components.Add(highScoreScene); highScoreScene.Show(false); // Create enterSound enterSoundIns = this.Content.Load <SoundEffect>("Sounds/enterSound").CreateInstance(); // Create and play music menuMusic = this.Content.Load <Song>("Sounds/pauseMenu"); MediaPlayer.Play(menuMusic); }
/// <summary> /// create a new highscore scene /// </summary> private void RebootHighScoreScene() { this.Components.Remove(highScoreScene); highScoreScene = new HighScoreScene(this, spriteBatch); this.Components.Add(highScoreScene); }
void Awake() { HSScreen = this; }