// Initialises all components underneath master. public override void InitialiseAll() { base.InitialiseAll(); particles.Initialise(); movementController.Initialise(); playerProperties.Initialise(); sounds.Initialise(); movementController.onCollision += OnPlayerHit; movementController.onNearMiss += OnPlayerNearMiss; playerProperties.onPlayerLose += OnPlayerLose; onMeterChanged += playerProperties.DecaySanityConstant; playerProperties.OnSoundChanged += sounds.AdjustAudioSourceVolume; onPlayerLost += sounds.StopBackgroundSound; movementController.onTimeChange += SetDecaySpeed; }
public override void Initialise() { base.Initialise(); GameStarted = false; onPlayerLost += menuManager.LoadLoseScreen; }
/// <summary> /// Initializes the values of this instance with the provided connection and name. /// </summary> /// <param name="connection"></param> /// <param name="name"></param> public void Initialize(Socket connection, string name) { this.id = id_counter; this.name = name; this.connection = connection; this.alive = true; this.score = 0; this.ready = false; id_counter++; ReadyToggled += new ReadyToggledHandler(Player_ReadyToggled); PlayerLost += new PlayerLostHandler(Player_PlayerLost); }