Пример #1
0
        private void OnFanTriggered(PipesGame sender, FanTriggeredEventArgs e)
        {
            // whenever a fan starts or stops, we check if the subsystem it belongs to has been solved by this very state change
            // if this is the case and the subsystem had not reached a solved state previously, some audio feedback (e.g. "well done!") should be played
            if (e.System.RunningFansCount >= e.System.FanCount && !solvedSubsystems[e.System.Index])
            {
                solvedSubsystems[e.System.Index] = true;

                // if two subsystem are solved in quick succession, another voice sample might still be playing which we need to stop first
                audio.StopVoice(49, 50, 51);

                // select and play a voice sample depending on how many subsystems have been solved
                switch (e.System.Index)
                {
                case 0:
                    audio.PlayVoice(49);
                    break;

                case 1:
                    audio.PlayVoice(50);
                    break;

                case 2:
                    audio.PlayVoice(51);
                    break;
                }
            }
        }
Пример #2
0
        public void OnFanTriggered(PipesGame sender, FanTriggeredEventArgs e)
        {
            // if the system with this fan is solved for the first time...
            if (e.System.RunningFansCount == e.System.FanCount && !solvedPipeSystems[e.System.Index])
            {
                solvedPipeSystems[e.System.Index] = true;

                // only make the drill sound louder if the game is not solved
                if (solvedPipeSystems.Contains(false))
                {
                    drillVolume += DrillVolumeStep;
                    audio.ChangeSoundVolume(02, drillVolume);
                }
            }
        }
Пример #3
0
        public void onFanTriggered(PipesGame sender, FanTriggeredEventArgs e)
        {
            if (e.Fan.IsRunning)
            {
                Statistics.pipesRunningFans++;
                Statistics.runningFansPerSubsystem[e.System.Index]++;
                if (Statistics.pipesRunningFans > Statistics.pipesMaxRunningFans)
                {
                    Statistics.pipesMaxRunningFans = Statistics.pipesRunningFans;
                }
            }
            else
            {
                Statistics.pipesRunningFans--;
                Statistics.runningFansPerSubsystem[e.System.Index]--;
            }

            if (e.System.RunningFansCount == e.System.FanCount)
            {
                Statistics.pipesSolvedSubsystems++;
            }
        }
Пример #4
0
 public void OnFanTriggered(PipesGame sender, FanTriggeredEventArgs e)
 {
     //print("PipesView.OnFanTriggered: " + fan.X + " " + fan.Y);
     gridElementImages[e.Fan.PxCoords].color = e.Fan.IsRunning ? activeFan : inactiveFan;
     lblFanCount.text = string.Format(fanCountStrF, sender.RunningFansCount, sender.FanCount);
 }
Пример #5
0
 private void OnFanTriggered(PipesGame sender, FanTriggeredEventArgs e)
 {
     Record(new FanTriggered(e.System.Index, e.Fan.Row, e.Fan.PositionInRow, e.Fan.IsRunning));
 }