public void update(InputState input) { if (input.isActive(InputState.Control.EXIT)) { this.exit = true; return; } if (null == this.runningTime) this.runningTime = Stopwatch.StartNew(); long deltaT = this.runningTime.ElapsedMilliseconds; if (deltaT > this.fadeInTime + this.fadeOutTime) { this.fadeAmount = 0.0f; } else if (deltaT > this.fadeInTime) { this.fadeAmount = 1.0f - (float) (deltaT - fadeInTime) / (float) fadeOutTime; } else { this.fadeAmount = (float)deltaT / (float)fadeInTime; } }
private bool hasExitState(InputState input) { if (this.exit) { return true; } if (this.song.stoppedPlaying() || input.isActive(InputState.Control.EXIT)) { exit = true; return true; } return false; }