protected override void LoadContent() { _gamePlaySong = Content.Load <Song>("Sounds\\battle"); _menuSong = Content.Load <Song>("Sounds\\menu_song2"); _dead = Content.Load <Song>("Sounds\\defeat"); MediaPlayer.IsRepeating = true; MediaPlayer.Play(_menuSong); _menuClickSelected = Content.Load <SoundEffect>("Sounds\\button-25"); _spriteBatch = new SpriteBatch(GraphicsDevice); _gameIsOn = false; SetScreenSize(); _gameOverScreen = new GameOverScreen(this, _spriteBatch, Content.Load <SpriteFont>("menufont"), Content.Load <Texture2D>("gameover_screen")); Components.Add(_gameOverScreen); _gameOverScreen.Hide(); _startScreen = new StartScreen(this, _spriteBatch, Content.Load <SpriteFont>("menufont"), Content.Load <Texture2D>("splash_screen")); Components.Add(_startScreen); _startScreen.Hide(); _actionScreen = new ActionScreen(this, _spriteBatch, Content.Load <Texture2D>("Levels\\level1_background")); Components.Add(_actionScreen); _actionScreen.Hide(); //_activeScreen = _gameOverScreen; //_gameOverScreen.SetScoreText(); _activeScreen = _startScreen; _activeScreen.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); // Menu _startScreen = new StartScreen(this, _spriteBatch, Content.Load <SpriteFont>("Fonts/gameFont"), Content.Load <Texture2D>("Background/startScreen")); Components.Add(_startScreen); _startScreen.Hide(); _actionScreen = new ActionScreen(this, _spriteBatch, Content.Load <Texture2D>("Background/spaceBackground")); Components.Add(_actionScreen); _actionScreen.Hide(); _activeScreen = _startScreen; _activeScreen.Show(); // Load _player Animation playerAnimation = new Animation(); Texture2D playerTexture = Content.Load <Texture2D>("Animation/Space Unicorn"); playerAnimation.Initialize(playerTexture, Vector2.Zero, 166, 100, 1, 5, Color.White, 1f, true); Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.Width / 4, GraphicsDevice.Viewport.Height / 2); _player.Initialize(playerAnimation, playerPosition); // Load enemy _enemyTexture = Content.Load <Texture2D>("Animation/enemy"); // Load background _bgLayer1.Initialize(Content, "Background/spaceBackground", GraphicsDevice.Viewport.Width, -1); // Load _marshmallows _marshmallowIcon = Content.Load <Texture2D>("Animation/marshmallowLaser"); // Load music _gameMusic = Content.Load <Song>("Music/Space Unicorn"); // Load explosion _explosionTexture = Content.Load <Texture2D>("Animation/explosion"); // Load _font _font = Content.Load <SpriteFont>("Fonts/gameFont"); // Load powers _healthBoostIcon = Content.Load <Texture2D>("Powers/healthPowerUp"); _speedIcon = Content.Load <Texture2D>("Powers/speedIncrease"); _hyperSpaceIcon = Content.Load <Texture2D>("Powers/hyperSpace"); _saviorIcon = Content.Load <Texture2D>("Powers/bomb"); _addFairyIcon = Content.Load <Texture2D>("Powers/addFairy"); // Play music PlayMusic(_gameMusic); }
protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); spriteFont = Content.Load <SpriteFont>("font"); formFont = Content.Load <SpriteFont>("FormFont"); popUpTexture = Content.Load <Texture2D>("quitscreen"); actionScreentexture = Content.Load <Texture2D>("greenmetal"); blankBlackTexture = Content.Load <Texture2D>("black"); //initialize and start the screens startScreen = new StartScreen(this, spriteBatch, formFont); Components.Add(startScreen); startScreen.ButtonClicked += new StartScreen.ClickEvent(HandleStartScreenButtons); startScreen.Hide(); networkScreen = new NetworkGameSelectScreen(this, spriteBatch, spriteFont, blankBlackTexture); Components.Add(networkScreen); networkScreen.ButtonClicked += new NetworkGameSelectScreen.ClickEvent(HandleNetworkSelectScreenButtons); networkScreen.Hide(); joinGameScreen = new JoinNetworkGameScreen(this, spriteBatch, formFont, blankBlackTexture); Components.Add(joinGameScreen); joinGameScreen.ButtonClicked += new JoinNetworkGameScreen.ClickEvent(HandleJoinGameScreenButtons); joinGameScreen.Hide(); hostGameScreen = new HostNetworkGameScreen(this, spriteBatch, formFont, blankBlackTexture); Components.Add(hostGameScreen); hostGameScreen.ButtonClicked += new HostNetworkGameScreen.ClickEvent(HandleHostGameScreenButtons); hostGameScreen.Hide(); actionScreen = new ActionScreen(this, spriteBatch, actionScreentexture); Components.Add(actionScreen); actionScreen.Hide(); popUpScreen = new PopUpScreen(this, spriteBatch, spriteFont, popUpTexture); Components.Add(popUpScreen); popUpScreen.Hide(); activeScreen = startScreen; //activeScreen = joinGameScreen; activeScreen.Show(); IsMouseVisible = true; }
/// <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); // Load the content for the start screen, add it to the components, and hide it. startScreen = new StartScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/StartScreen")); Components.Add(startScreen); startScreen.Hide(); // Load the content for the loading screen. splashScreen = new SplashScreen(this, spriteBatch, Content.Load<Texture2D>("Menus/SampleSplashScreen")); Components.Add(splashScreen); splashScreen.Hide(); // Load the content for the action screen, where most of the gameplay will occur. actionScreen = new ActionScreen(this, spriteBatch); Components.Add(actionScreen); actionScreen.Hide(); // Load the content for the pause screen. pauseScreen = new PauseScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/PauseScreen"), actionScreen); Components.Add(pauseScreen); pauseScreen.Hide(); // Load the content for the quit screen. quitScreen = new QuitScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/QuitScreen"), actionScreen); Components.Add(quitScreen); quitScreen.Hide(); // Load the content for the dialogue screen. dialogueScreen = new DialogueScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/DialogueScreen"), actionScreen); Components.Add(dialogueScreen); dialogueScreen.Hide(); // When the game starts, the active screen is the start screen. activeScreen = startScreen; activeScreen.Show(); }