cs193p – Assignment #3 Task #4

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

The user must then be able to choose matches just like in last week’s assignment.

In storyboard add a tap gesture to the collection view and connect it to the flipCard method and done.

… actually … nothing will happen yet. Because the view does not know it has changed. It is necessary to call setNeedsDisplay when one of the properties has changed:
Continue reading “cs193p – Assignment #3 Task #4”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #3

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

For Set, 12 cards should be initially dealt and Set cards should always show what’s on them even if they are technically “face down”. For the Playing Card game deal 22 cards, all face down.

Start by removing the card buttons from the set view controller in storyboard and remove the parts in the set-view-controller class which access the former card buttons – at the same time you can move lots of the public interface of the generic game-view-controller class back to be private … which is mostly cosmetic …

And because there are no card buttons any more set the starting number of cards to 12:
Continue reading “cs193p – Assignment #3 Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #1 & #2

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

Create an application that plays both the Set game (single player) in one tab and the Playing Card matching game in another.

… the current version does already do that, just make sure not to break anything in the following tasks

You must use polymorphism to design your Controllers for the two games (i.e. you must have a (probably abstract) base card game Controller class and your Set game and Playing Card game Controllers must be subclasses thereof).

… which we actually have done already in the last assignment. But we can still clean up a little bit, e.g by removing the access to the direct access of game and gameResult by adding additional abstract properties:
Continue reading “cs193p – Assignment #3 Task #1 & #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #7 – Collection View and Protocols

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

Lecture #7 handles protocols, collection views – again – with an extensive demo.

… lots about protocols and its usage …

UICollectionsViews are new in IOS6. They are assemblies of UICollectionViewCells arranged e.g. by UICollectionViewFlowLayout.

The code of the demo is available at Stanford and on github.

Slides are available on iTunes …..

The lecture is available at iTunes and is named “7. Collection View and Protocols (January 29, 2013)”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #6 – Views and Gestures

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

Lecture #6 covers views and gestures and shows how to use them in a extensive demo at the end of the lecture:

The hierarchy of views is most often constructed in storyboard but it can be done also:

- (void)addSubview:(UIView*)aView;
- (void)removeFromSuperview;

A view can be accessed from a view controller using its:

@property (strong, nonatomic) UIView *view

Continue reading “cs193p – Lecture #6 – Views and Gestures”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #2 Extra Task #3

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

Add another tab for some “settings” in the game.

We will need to access the settings from both card games as well as from the settings view. Therefore we create a new class derived from NSObject with public properties of the “settings” which can be used by all of those controllers:

@interface GameSettings : NSObject
@property (nonatomic) int matchBonus;
@property (nonatomic) int mismatchPenalty;
@property (nonatomic) int flipCost;
@end

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

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #2 Extra Task #2

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

Add third tab to track the user’s scores. It should be clear which scores were playing card match games and which scores were Set card match games.

The tab has already been implemented during lecture #5.

To be able to separate the scores of the different games, it is necessary to another property which can provide this information:

@property (strong, nonatomic) NSString *gameType;

Continue reading “cs193p – Assignment #2 Extra Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail