-
Notifications
You must be signed in to change notification settings - Fork 227
Complete Project - Cora Jacobson #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Complete Project - Cora Jacobson #223
Conversation
swift-student
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job figuring out the position persistence
@swift-student