Skip to content

Commit ed6c0de

Browse files
committed
bug fix & renamed a few files
1 parent 96b8ae6 commit ed6c0de

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed
0 Bytes
Binary file not shown.

WWDC 2018 Debug Xcode Project/WWDC SUBMISSION 2018.playground/Resources/note.png renamed to WWDC 2018 Debug Xcode Project/WWDC SUBMISSION 2018.playground/Resources/boosterTexture.png

File renamed without changes.
Binary file not shown.

WWDC 2018 Debug Xcode Project/WWDC SUBMISSION 2018.playground/Sources/GameScene.swift

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -665,18 +665,21 @@ public class GameScene: SKScene, SKPhysicsContactDelegate {
665665
if(songTitles.indices.contains(currentLevel - 1)) {
666666

667667

668-
delay(2) {
669-
//play level animation
670-
self.levelAnimation(level: "\(self.currentLevel)", song: songTitles[self.currentLevel - 1])
671-
//clear songArray and re-populate with new song
672-
self.song.clear()
673-
self.song.setup(level: self.currentLevel)
674-
//reset index
675-
self.i = -1
676-
677-
//wait for the levelAnimation complete before generating the new song
678-
delay(4) {
679-
self.generateSong()
668+
//ensure the game hasn't ended while the last note is generatedcontains
669+
if userInterationEnabled {
670+
delay(2) {
671+
//play level animation
672+
self.levelAnimation(level: "\(self.currentLevel)", song: songTitles[self.currentLevel - 1])
673+
//clear songArray and re-populate with new song
674+
self.song.clear()
675+
self.song.setup(level: self.currentLevel)
676+
//reset index
677+
self.i = -1
678+
679+
//wait for the levelAnimation complete before generating the new song
680+
delay(4) {
681+
self.generateSong()
682+
}
680683
}
681684
}
682685

0 commit comments

Comments
 (0)