Skip to content

Conversation

@CoraJacobson
Copy link

Copy link

@swift-student swift-student left a 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!

Comment on lines +17 to +22
var shouldRoll = false
var shouldZoom = false
var shouldFade = false
var shouldDance = false
var texture = "HappyCrab"
var lastPosition: CGPoint? = nil

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!

Comment on lines +45 to +51
@IBAction func toggleTexture(_ sender: UISegmentedControl) {
if sender.selectedSegmentIndex == 1 {
Settings.shared.texture = "WaitingCrab"
} else {
Settings.shared.texture = "HappyCrab"
}
}

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.

Comment on lines +79 to +82
if Settings.shared.shouldDance {
let sequenceAction = SKAction.sequence([danceStartAction, danceRightAction, danceLeftAction, danceRightAction, danceLeftAction, danceRightAction, danceLeftAction, danceEndAction, moveAction])
crab.run(sequenceAction)
}

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).

Comment on lines +26 to +30
if let lastPosition = Settings.shared.lastPosition {
crab.position = lastPosition
} else {
crab.position = CGPoint(x: frame.midX, y: frame.midY)
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants