Session 6

Fun and Games

Session Materials

Resources

Assignment

In this assignment, you will create a gesture-drive tic tac toe game. The game should be designed for two players to play against each other. You do not need to implement a game engine to play against for a single player. The key technologies utilized will be UIGestureRecognizers and advanced methods available in UIView. This assignment will require the use of both storyboards and programmatic interface design.

Project Setup

Figure 1. The main layout user interface.
Figure 1. The main layout user interface.

View Controllers

User Interface

The Grid

Figure 2. A grid of transparent views should occupy each space in the grid.
Figure 2. A grid of transparent views should occupy each space in the grid.

X’s and O’s

Tip: Remember to enable touches on the image view.



Model and Data

Game Instructions

Functionality

Tip: Think about the touch phase to ensure this happens at the correct time.



Tip: Make sure to use the correct touch phase so you are only testing once the player has finished the move.



Tip: Use `CGRectIntersectsRect` to determine if view frames are intersecting. You will want to test view the *frame* property of a dragged X or O against views (UIView 1, UIView 2, UIView 3, etc.) that are backing the grid.



Tip: Look at the audio loop files in iMovie for sound effect files. These are all properly formatted and allowed to be in apps in the App Store.



Tip: You need to present a custom `UIView` at three different places in the app. It would be a best practice to create one that you can reuse, passing along an `NSString` with the message to display.



Figure 3. When the game is over show a custom view that allows the players to begin a new game.  For the 10th point, draw a line that shows the winning play.
Figure 3. When the game is over show a custom view that allows the players to begin a new game. For the 10th point, draw a line that shows the winning play.

Grading

The application should compile with no errors or warnings and perform all described behaviors. If the app does not compile you will receive a 0. Feel free to explore additional enhancements to improve the appearance or functionality of the application.

An 11th point will be awarded for applications that add the following:

Requirements Reminders

Due Date

Assignment 6 is due August 2, 2017 at 5:29pm.