Complete Project - Cora Jacobson#223
Complete Project - Cora Jacobson#223CoraJacobson wants to merge 3 commits intobloominstituteoftechnology:masterfrom
Conversation
swift-student
left a comment
There was a problem hiding this comment.
You went above and beyond again! I really enjoyed your additions to this project, especially the dancing :) Your code was clean, auto layout was nice, tab bar and storyboards were set up nicely. Well done!
| var shouldRoll = false | ||
| var shouldZoom = false | ||
| var shouldFade = false | ||
| var shouldDance = false | ||
| var texture = "HappyCrab" | ||
| var lastPosition: CGPoint? = nil |
There was a problem hiding this comment.
Love that you added all these settings!
| @IBAction func toggleTexture(_ sender: UISegmentedControl) { | ||
| if sender.selectedSegmentIndex == 1 { | ||
| Settings.shared.texture = "WaitingCrab" | ||
| } else { | ||
| Settings.shared.texture = "HappyCrab" | ||
| } | ||
| } |
There was a problem hiding this comment.
I like the use of the segmented control here.
| if Settings.shared.shouldDance { | ||
| let sequenceAction = SKAction.sequence([danceStartAction, danceRightAction, danceLeftAction, danceRightAction, danceLeftAction, danceRightAction, danceLeftAction, danceEndAction, moveAction]) | ||
| crab.run(sequenceAction) | ||
| } |
There was a problem hiding this comment.
This is great! One thing I will say, is with long lines like this, most places have a line limit that they like to stick to, so you might consider putting a return in there somewhere, or even putting each item on it's own line. It's all personal style though (you will have to use a linter later in the course which basically enforces some formatting rules).
| if let lastPosition = Settings.shared.lastPosition { | ||
| crab.position = lastPosition | ||
| } else { | ||
| crab.position = CGPoint(x: frame.midX, y: frame.midY) | ||
| } |
There was a problem hiding this comment.
Nice job figuring out the position persistence
@swift-student