Merge branch '97-music-flag' into 'development'
Resolve "Music Flag" Closes #97 See merge request marcel.schwarz/software-projekt-2!116
This commit is contained in:
commit
79781ccdc9
@ -56,7 +56,7 @@ class MenuScene: SKScene {
|
|||||||
entityManager.add(Background(size: self.size))
|
entityManager.add(Background(size: self.size))
|
||||||
entityManager.add(SpinningLogoEntity(position: CGPoint(x: midX, y: midY + 200)))
|
entityManager.add(SpinningLogoEntity(position: CGPoint(x: midX, y: midY + 200)))
|
||||||
|
|
||||||
if SoundManager.sharedInstance.isMusicPlaying == false && SoundManager.sharedInstance.isMusicEnabled == true {
|
if SoundManager.sharedInstance.isMusicPlaying == false && SoundManager.sharedInstance.isMusicEnabled == true && !CommandLine.arguments.contains("--no-music") && !UserDefaults.standard.bool(forKey: "noMusic"){
|
||||||
SoundManager.sharedInstance.startMenuMusic()
|
SoundManager.sharedInstance.startMenuMusic()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,12 +29,14 @@ class SoundManager {
|
|||||||
audioPlayer.prepareToPlay()
|
audioPlayer.prepareToPlay()
|
||||||
if self.isMusicEnabled == true {
|
if self.isMusicEnabled == true {
|
||||||
audioPlayer.play()
|
audioPlayer.play()
|
||||||
|
UserDefaults.standard.set(false, forKey: "noMusic")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func stopMenuMusic() {
|
func stopMenuMusic() {
|
||||||
audioPlayer.pause()
|
audioPlayer.pause()
|
||||||
self.isMusicPlaying = false
|
self.isMusicPlaying = false
|
||||||
|
UserDefaults.standard.set(true, forKey: "noMusic")
|
||||||
}
|
}
|
||||||
|
|
||||||
func setVolume(_ volume: Float) {
|
func setVolume(_ volume: Float) {
|
||||||
|
Loading…
Reference in New Issue
Block a user