/// <summary> /// Method that updates the game /// </summary> /// <param name="input">Input</param> /// <param name="gameTime">GameTime</param> public override void Update(Input input, GameTime gameTime) { base.Update(input, gameTime); // Check if the camera is not hacked if (!hacked) { var pos = new Vector2(); // Check if the CCTV camera can see the player if (CanSee(out pos)) { var guards = MonoGearGame.FindEntitiesWithTag("Guard"); // Alert all guards in the vicinity foreach (var g in guards) { var guard = g as Guard; if (guard != null) { guard.Alert(pos); } } } } else { // Disable the CCTV camera if it's hacked Enabled = false; } }
/// <summary> /// Method that executes when the level is loaded. /// </summary> public override void OnLevelLoaded() { base.OnLevelLoaded(); // Find the player player = MonoGearGame.FindEntitiesWithTag("Player")[0] as Player; //Play the explotion sound on creation sound = AudioManager.AddPositionalAudio(MonoGearGame.GetResource <SoundEffect>("Audio/AudioFX/Explosion"), 1, 1200, Position, false); sound.Position = Position; sound.Volume = 0.8f; }
/// <summary> /// Method that executes when the level is loaded. /// </summary> public override void OnLevelLoaded() { base.OnLevelLoaded(); player = MonoGearGame.FindEntitiesWithTag("Player")[0] as Player; //Reset the objectives list and sort in on index objectives.Clear(); objectives.AddRange(MonoGearGame.FindEntitiesOfType <Objective>()); objectives.Sort((a, b) => a.Index.CompareTo(b.Index)); }
/// <summary> /// Method used to disable the gameover screen /// </summary> public void DisableGameOver() { // Find the player player = MonoGearGame.FindEntitiesWithTag("Player")[0] as Player; gameOver = false; Visible = false; player.Enabled = true; player.Visible = true; MonoGearGame.FindEntitiesOfType <GameUI>()[0].Enabled = true; MonoGearGame.FindEntitiesOfType <GameUI>()[0].Visible = true; }
/// <summary> /// Called when level is loaded /// </summary> public override void OnLevelLoaded() { base.OnLevelLoaded(); // Find spawnpoint and place player on it var ents = MonoGearGame.FindEntitiesWithTag("PlayerSpawnPoint"); if (ents.Count > 0) { Position = new Vector2(ents[0].Position.X, ents[0].Position.Y); } }
/// <summary> /// Method that executes when the level is loaded. /// </summary> public override void OnLevelLoaded() { base.OnLevelLoaded(); player = MonoGearGame.FindEntitiesWithTag("Player")[0] as Player; if (props == null) { props = MonoGearGame.GetResource <Texture2D>("Sprites/Soisoisoisoisoisoisoisoisoisoisoisoisoisoisoisois"); } heliSound = AudioManager.AddPositionalAudio(MonoGearGame.GetResource <SoundEffect>("Audio/AudioFX/Helicopter Sound Effect"), 1, 300, Position, true); heliSound.Volume = 0.1f; destoyedSprite = MonoGearGame.GetResource <Texture2D>("Sprites/BrokenRoflcopter"); }
/// <summary> /// Method used to enable the gameover screen /// </summary> public void EnableGameOver() { // Find the player player = MonoGearGame.FindEntitiesWithTag("Player")[0] as Player; gameOver = true; Position = player.Position; Visible = true; player.Enabled = false; var sound = MonoGearGame.GetResource <SoundEffect>("Audio/AudioFX/Wasted_sound").CreateInstance(); sound.Volume = 0.5f * SettingsPage.Volume * SettingsPage.EffectVolume; sound.Play(); }
/// <summary> /// Method that executes when the level is loaded. /// </summary> public override void OnLevelLoaded() { base.OnLevelLoaded(); player = MonoGearGame.FindEntitiesWithTag("Player")[0] as Player; }