/// <summary> /// Load graphics content. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(graphics.GraphicsDevice); spriteFont = Content.Load<SpriteFont>("Fonts/Debug"); terrain = Content.Load<Model>("Models/desert"); font = Content.Load<SpriteFont>("Fonts/Debug"); CubeModel = Content.Load<Model>("Models/bullet"); cockpit = Content.Load<Texture2D>("Textures/cockpit"); skybox = new Skybox("Skyboxes/Sunset", Content); laser = Content.Load<SoundEffect>("Audio/Laser"); music = Content.Load<Song>("Audio/background"); if (playMusic == true) { MediaPlayer.Play(music); } if (playMusic == false) { MediaPlayer.Stop(); } DrawTerrain(); }
/// LoadContent will be called once per game and is the place to load all of your content. protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); //Assigns the fontToUse variable to the font. fontToUse = Content.Load<SpriteFont>(".\\Fonts\\DrWho"); //Links the player variable to the model which will be controlled by the user/player player = new Player("Models\\dalek", Content); // Loads all assets for daleks and lasers mdlDalek = Content.Load<Model>(".\\Models\\dalek"); mdDalekTransforms = SetupEffectTransformDefaults(mdlDalek); mdlLaser = Content.Load<Model>(".\\Models\\laser"); mdlLaserTransforms = SetupEffectTransformDefaults(mdlLaser); // Loads Audio bkgMusic = Content.Load<Song>(".\\Audio\\Bluebell"); click = Content.Load<SoundEffect>("Audio\\Click"); //Loads Skybox skybox = new Skybox("Skybox/Sunset", Content); //load heightMap and heightMapTexture to create landscape landscape.SetHeightMapData(Content.Load<Texture2D>("Textures\\HeightMap"), Content.Load<Texture2D>("Textures\\TextureMap")); //Loads the background texture for the memu backGround = Content.Load<Texture2D>("Textures\\Background"); // TODO: use this.Content to load your game content here }