Language:EN
Pages: 10
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
the touched card was not part the matching set

The touched card was not part the matching set

CS193P IOS APPLICATION DEVELOPMENT

SPRING 2020

Assignment III: Set

This assignment is a great opportunity to tackle a lot of the Extra Credit if you really want to challenge yourself.

Also, check out the latest in the Evaluation section to make sure you understand what you are going to be evaluated on with this assignment.

ASSIGNMENT III: SET
SPRING 2020

Required Tasks

1. Implement a game of solo (i.e. one player) Set.

6. Users must be able to select up to 3 cards by touching on them in an attempt to make a Set (i.e. 3 cards which match, per the rules of Set). It must be clearly visible to the user which cards have been selected so far.

7. After 3 cards have been selected, you must indicate whether those 3 cards are a match or mismatch. You can show this any way you want (colors, borders, backgrounds, animation, whatever). Anytime there are 3 cards currently selected, it must be clear to the user whether they are a match or not (and the cards involved in a non-matching trio must look different than the cards look when there are only 1 or 2 cards in the selection).

ASSIGNMENT III: SET
SPRING 2020

11.You will need to have a “Deal 3 More Cards” button (per the rules of Set).

a. when it is touched, replace the selected cards if the selected cards make a Set (with fly-in/fly-away as described above)
b. or, if the selected cards do not make a Set (or if there are fewer than 3 cards selected, including none), fly in (i.e. animate the arrival of) 3 new cards to join the ones already on screen (and do not affect the selection)
c. disable this button if the deck is empty
12.You also must have a “New Game” button that starts a new game (i.e. back to 12 randomly chosen cards). Cards should fly in and out when this happens as well.

18.You must use a closure (i.e. a function as an argument) as a meaningful part of your solution.

PAGE OF 10

ASSIGNMENT III: SET
SPRING 2020
ASSIGNMENT III: SET
SPRING 2020

Hints

1. Feel free to use Grid to lay out your cards if you’d like. You are not required to do so, however. You can also modify it if you want, but that’s unlikely to be necessary.

6. Don’t forget that the View is just always a reflection of the Model. This is “reactive”, “declarative” UI programming. The Model changes and the View is just declared to look like something completely based on the current state of the Model (accessed by the View through the ViewModel of course). Try to break free from the “imperative” model of programming you’ve probably grown up with (i.e. you call a function and something happens and then you call another function and something else happens, etc.). That’s not how we do UI in SwiftUI.

7. Along those lines, remember that any animation that is going on is just showing the user over time something that has already happened. Note also that you will not need to do any “animations of the things are are going to happen soon” like we had to do for our Pie in Memorize. All animations in this Set application are straightforwardly showing things that have already happened (like cards were dealt or cards were chosen or cards were matched and discarded).

ASSIGNMENT III: SET
SPRING 2020

9.a. All of the required tasks for “flying” cards are simply talking about the Views that represent a card “coming and going” from the UI.

9.b. The “comings and goings” of Views in SwiftUI is animated using transitions (as explained in lecture).

9.g. Your View, as always, just draws the state of the Model. So, for example, the array of Identifiables in the Grid (assuming you’re using that to display your cards) is not going to include cards that haven’t been dealt or that have been matched and discarded.

9.h. Remember that transition animations don’t happen unless you are explicitly animating. So you’ll need any action the user takes that might cause flying cards to be explicitly animated using withAnimation.

PAGE OF 10

ASSIGNMENT III: SET

CS193P IOS APPLICATION DEVELOPMENT

SPRING 2020
ASSIGNMENT III: SET

CS193P IOS APPLICATION DEVELOPMENT

SPRING 2020

Things to Learn
Here is a partial list of concepts this assignment is intended to let you gain practice with or otherwise demonstrate your knowledge of.

ASSIGNMENT III: SET
SPRING 2020

In all of the assignments this quarter, writing quality code that builds without warnings or errors, and then testing the resulting application and iterating until it functions properly is the goal.

Here are the most common reasons assignments are marked down:

Project does not build without warnings.

Code is visually sloppy and hard to read (e.g. indentation is not consistent, etc.).

ASSIGNMENT III: SET

CS193P IOS APPLICATION DEVELOPMENT

SPRING 2020

Extra Credit

4. Draw the actual striped “shading” instead of using a semi-transparent color.

5. When cards match, provide some exciting animation. In other words, use animation to show that cards are matched in Required Task 7.

10. Add a “cheat” button to your UI.

11. Support two players. No need to go overboard here. Maybe just a button for each user (one upside-down at the top of the screen maybe?) to claim that they see a Set on the board. Then that player gets a (fairly short) amount of time to actually choose the Set or the other person gets as much time as they want to try to find a Set (or maybe they get a longer, but not unlimited amount of time?). Maybe hitting “Deal 3 More Cards” by one user gives the other some medium amount of time to choose a Set without penalty? You will need to figure out how to use Timer to do these time-limited things.

ASSIGNMENT III: SET

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Ritvik Andra

PageId: DOC3BB3280