cs193p – Assignment #4 Extra Task #4

Please note, this blog entry is from a previous course. You might want to check out the current one.

Think of some other way(s) to use animation in your application and implement it.

What happens if you shake your iPhone? The card go crazy:
Continue reading “cs193p – Assignment #4 Extra Task #4”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Extra Task #3

Please note, this blog entry is from a previous course. You might want to check out the current one.

Make the Set game a two player game. There’s no need to go overboard here. Think of a simple UI and a straightforward implementation that make sense.

In storyboard dublicate the set-game view controller, add a now image for the tab bar and remove the cheat button (we did not add a penalty for cheating in task #2 and it would be unfair for the two player game πŸ˜‰ ) – and of course link it to the tab view contorller:

cs193p – assignment #4 extra task #3 – two-player view controller
cs193p – assignment #4 extra task #3 – two-player view controller

Continue reading “cs193p – Assignment #4 Extra Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Extra Task #2

Please note, this blog entry is from a previous course. You might want to check out the current one.

Knowing how to find Sets in the remaining cards also would allow you to let the user cheat. Have a button that will show them a Set (if available). It’s up to you how you want to show it, but maybe some little indicator (a star or something) on each of the 3 cards?

Add a new button to storyboard:

cs193p – assignment #4 extra task #2 – cheat button
cs193p – assignment #4 extra task #2 – cheat button

… and link to an action which stores a possible combination in a new property:
Continue reading “cs193p – Assignment #4 Extra Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Extra Task #1

Please note, this blog entry is from a previous course. You might want to check out the current one.

You could add better score-keeping to the Set part of this application if you can figure out an algorithm for calculating whether a Set exists in the current cards in play. Then you can penalize the user not only for mismatches, but for clicking the β€œdeal 3 more cards” button if he or she missed a Set. You’d also know when the game was β€œover” (because the user would click on β€œdeal 3 more cards” and there would be no more cards in the deck and no more Sets to choose).

The game model needs a new public method returning matching cards. For this task a method returning a boolean result would be sufficient, but we will use the same method for the next task:

- (NSArray *)findCombination;

Continue reading “cs193p – Assignment #4 Extra Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Task #10

Please note, this blog entry is from a previous course. You might want to check out the current one.

Use a UIDynamicAnimator to allow the cards in either game to be gathered up into a pile via a pinch gesture. Once gathered, the stack of gathered cards must be able to be moved around (via a pan gesture). Tapping on the stack will return the cards to their normal positions (animated, of course) unharmed.


Start by adding a pan and a pinch to the grid views of both game view controllers in storyboard and link them to actions in the generic game-view-controller class.

Add a new property to the game-view-controller class, which will store the current animations:

@property (strong, nonatomic) UIDynamicAnimator *pileAnimator;

Continue reading “cs193p – Assignment #4 Task #10”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Task #9

Please note, this blog entry is from a previous course. You might want to check out the current one.

The movement of the elements inside your UI that occur in response to device rotation must be animated (Autolayout already animates any changes it makes for you, but any other layout changes that you do in code must be animated by you).

… actually already handled by the previous task.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Task #8

Please note, this blog entry is from a previous course. You might want to check out the current one.

The game must work properly (and look good) in both Landscape and Portrait orientations on both the iPhone 4 and the iPhone 5. Use Autolayout as much as possible to make this work. Positioning the cards themselves will require some additional work (although you are probably already doing this work for some of the Required Tasks above). None of your code should be specific to any given screen width or height or orientation (i.e. no β€œif landscape then” or β€œif width/height … then” code). The bottom line of this task is that your MVCs’ Views should look good in any reasonably-sized bounds rectangle.

Go to storyboard make sure, all views in all controllers are where they should be (aligned with blue lines etc…), and add constraints using “reset to suggested constraints”:

cs193p – assignment #4 task #8 – set suggested constraints
cs193p – assignment #4 task #8 – set suggested constraints

Continue reading “cs193p – Assignment #4 Task #8”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail