/// <summary> /// Initializes a new instance of the <see cref="SceneManager"/> class. /// </summary> /// <param name="game">game reference object.</param> public SceneManager(EverLite game) { this.game = game; this.volume = VolumeManager.Instance; this.soundManager = SoundManager.Instance; this.sound = SoundManager.Instance; Initialize(); }
public SeismicChargeCountManager(EverLite game) { this.game = game; charges = new SeismicChargeCount(3); player = Player.Instance(); display = new SeismicChargesDisplay(charges); player.OnBombPress += (sender, e) => { if (this.charges.Charges > 0) { this.deployedBombs.Add(charges.SpawnBomb(this.player.Position)); } }; player.OnBombPickup += (sender, e) => { this.charges.AddCharge(); }; }
public PlayerLifeManager(EverLite game) { this.game = game; lives = new PlayerLives(10); player = Player.Instance(); sound = SoundManager.Instance; volume = VolumeManager.Instance; display = new PlayerLivesDisplay(lives); player.OnCollide += (sender, e) => { lives.TakeDamage(); }; lives.OnDeath += (sender, e) => { this.sound.Losing.Play(volume: volume.SoundLevel, pitch: 0.0f, pan: 0.0f); this.game.SceneManager.ChangeMusic(this.sound.Megalovania); this.game.SceneManager.SwitchScene(this.game.SceneManager.GameOver); }; }
/// <summary> /// Initializes a new instance of the <see cref="PlayGameComponent"/> class. /// </summary> /// <param name="game">game reference object.</param> public PlayGameComponent(EverLite game) : base(game) { this.game = game; this.volume = VolumeManager.Instance; this.sound = SoundManager.Instance; this.sidePanel = new SidePanelComponent(game); this.playerSettings = PlayerSettings.Instance; this.pauseStatus = new ToggleStatus(this.playerSettings.Pause); this.playerSystem = new PlayerSystem(this.Game); this.enemyManager = new EnemyManager(this.Game); this.bulletManager = BulletManager.Instance; this.collisionDetector = new CollisionDetector( this.enemyManager.ActiveEnemies, this.bulletManager.EnemyBullets, this.bulletManager.PlayerBullets, this.itemsManager.Items, this.playerSystem.Player, this.game); // Game1 game is passed to the collisioDetector can access the gamescore instance this.transformManager = TransformManager.Instance; }