/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> public void LoadContent() { inputController1 = new InputController(PlayerIndex.One); AudioHandler.Instance.SetGameReference(gameReference); Spawner.Instance.SetGameReference(gameReference); gameOverSoundEffect = AudioHandler.Instance.LoadSoundEffect(AudioHandler.TypeOfSound.GameOver_Music); gameOverSoundEffectInstance = gameOverSoundEffect.CreateInstance(); gameOverSoundEffectInstance.Volume = 0.2f; gameOverSoundEffectInstance.IsLooped = true; gameOverSoundEffectInstance.Play(); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(gameReference.GraphicsDevice); // TODO: use this.Content to load your game content here //Load textures background = gameReference.Content.Load <Texture2D>("Background_1280x720.png"); gameOver = gameReference.Content.Load <Texture2D>("Gameover.png"); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> public void LoadContent() { inputController1 = new InputController(PlayerIndex.One); AudioHandler.Instance.SetGameReference(gameReference); Spawner.Instance.SetGameReference(gameReference); gameSoundEffect = AudioHandler.Instance.LoadSoundEffect(AudioHandler.TypeOfSound.Game_Music); gameSoundEffectInstance = gameSoundEffect.CreateInstance(); gameSoundEffectInstance.Volume = 0.2f; gameSoundEffectInstance.IsLooped = true; gameSoundEffectInstance.Play(); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(gameReference.GraphicsDevice); // TODO: use this.Content to load your game content here //Load textures backgroundTexture = gameReference.Content.Load <Texture2D>("Background_1280x720.png"); //Temp GUI Weapon show Pause = gameReference.Content.Load <Texture2D>("Pause.png"); //Make gameobjects Rocket _rocket = (Rocket)Spawner.Instance.Spawn(Spawner.TypeOfGameObject.Rocket, new Vector2(608, 328)); _rocket.maxHealth = 10; _rocket.maxShield = 10; _rocket.Scale = 0.7f; RocketHit _rocketHit = (RocketHit)Spawner.Instance.Spawn(Spawner.TypeOfGameObject.RocketHit, new Vector2(-1000, -1000)); _rocketHit.Scale = 0.7f; AutoLaserLost _autoLaserLost = (AutoLaserLost)Spawner.Instance.Spawn(Spawner.TypeOfGameObject.AutoLaserLost, new Vector2(500, 20)); _autoLaserLost.Scale = 2f; MissileLost _missileLost = (MissileLost)Spawner.Instance.Spawn(Spawner.TypeOfGameObject.MissileLost, new Vector2(500, 20)); _missileLost.Scale = 2f; ShieldRegenLost _shieldRegenLost = (ShieldRegenLost)Spawner.Instance.Spawn(Spawner.TypeOfGameObject.ShieldRegenLost, new Vector2(500, 20)); _shieldRegenLost.Scale = 2f; ShieldLost _shielLost = (ShieldLost)Spawner.Instance.Spawn(Spawner.TypeOfGameObject.ShieldLost, new Vector2(500, 20)); _shielLost.Scale = 2f; UI ui = (UI)Spawner.Instance.Spawn(Spawner.TypeOfGameObject.UI, new Vector2(0, 640)); //Controllers inputController1.InputGamePadLeftStickListeners.Add(_rocket); }