cs193p – Assignment #3 Task #6

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

Set cards must have the “standard” Set look and feel (i.e. 1, 2 or 3 squiggles, diamonds or ovals that are solid, striped or unfilled, and are either green, red or purple). You must draw these using Core Graphics and/or UIBezierPath. You may not use images or attributed strings. Use the PlayingCardView from the in-class demo to draw your Playing Card game cards.

Adjust the drawRect: method of the set-card view to call a new method to draw the symbal (which is actually not really necessary but makes the code a little bit more sructurized):
Continue reading “cs193p – Assignment #3 Task #6”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #5

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

When a Set match is successfully chosen, the cards should be removed from the game (not just blanked out or grayed out, but actually removed from the user-interface and the remaining cards rearranged to use up the space that was freed up in the user- interface).

The card-matching-game model needs a new property to show how many cards are currently available, and a new property to remove a specific card:
Continue reading “cs193p – Assignment #3 Task #5”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

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

cs106a – Assignment #3 – Extra Task #5

The complete specification of assignment #3 can be found as part of the stream at iTunes.

Keep score

You could easily keep score, generating points for each brick. In the arcade game, bricks were more valuable higher up in the array, so that you got more points for red bricks than cyan bricks. You could display the score underneath the paddle, since it won’t get in the way there.

Add two new instance variables, one for accessing the label and one for storing the actual score. Setup the score label. Finally adjust the score according to the color of the hid brick:
Continue reading “cs106a – Assignment #3 – Extra Task #5”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs106a – Assignment #3 – Extra Task #4

The complete specification of assignment #3 can be found as part of the stream at iTunes.

Add in the “kicker”

The arcade version of Breakout lured you in by starting off slowly. But, as soon as you thought you were getting the hang of things, the program sped up, making life just a bit more exciting. The applet version implements this feature by doubling the horizontal velocity of the ball the seventh time it hits the paddle, figuring that’s the time the player is growing complacent.

Add a constant to hold the given number of paddle hits for which the velocity should double, and an instance variable to count the hits. Reset this variable when the ball is setup. Finally adjust the collision checker to count the hits and increase the horizontal velocity after the given count of hits:
Continue reading “cs106a – Assignment #3 – Extra Task #4”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail