CSCI 448 - Mobile Application Development

Spring 2016 - Assignment 2 - Global Thermonuclear War

|   Home |  Syllabus |  Assignments |  Schedule |  Resources   |
This assignment is due by February 8, 2016 by 2:59pm.

Global Thermonuclear War
Shall we play a game?

For this assignment, you will implement a simple game such as Tic-Tac-Toe. Gameplay is not the focus of this assignment, so you may choose a game besides Tic-Tac-Toe (Connect4, BlackJack, etc.). Tic-Tac-Toe has a simple fixed game mechanic so should be easy to implement.

The App will be comprised of three activities:
  1. WelcomeActivity
  2. OptionsActivity
  3. GameActivity
WelcomeActivity will load when the App is launched. The other two activities will be able to be started through an Explicit Intent. You will need to pass Extras with the Intent and have the child activity return a result to the parent. Information about the game will need to be passed from activity to activity for the life of the App.

The App should keep track of how many games have been won/lost/drawn and display this information to the user. As the user navigates between activities, the score should not reset (unless the user goes through the options, see below). Speaking of options, however the user chooses to play the game, needs to be tracked and applied to every game that is played. This is where the Extras and Results will come into use.

When you create this project, set the domain to include <userName_A2> and name the app <userName>_A2 where userName is your name.

Only Winning Move
The only winning move is not to play.


Part I - Activity One: The Welcome Screen


The layout for the Welcome Screen is very simple. Present the user with three buttons:
  1. New Game
  2. Options
  3. Quit
Pressing the New Game button will start the Game Activity and start a new game.

Pressing the Options button will start the Options Activity and present the user with ways to change the game play.

Pressing the Quit button will close the App in a graceful manner (no errors, message boxes, etc.).

A very very simple example is shown below:
Welcome Screenshot


Part II - Activity Two: The Options Screen


The layout for the Options Screen is up to you. Present the user with options that make sense for your game. For Tic-Tac-Toe, you should allow the user to choose:
  • Number of Players: 1 or 2
  • Who Plays First? X or O
Additionally, add a button that will clear the score tally.

You may add as many options as you like (colors, computer difficulty, special messages, X & O piece choices). Have fun with it!


Part III - Activity Three: The Game Screen


This is where the magic happens. You can decide what the layout for this screen should be. Tic-Tac-Toe will need some sort of 3x3 interface for the user to select where to play. On this screen, display to the user the score (how many times X won, O won, game was a draw). Do not use simple text output for the pieces (literally "X" and "O") but instead use ImageButtons or ImageViews to spice up your game with exciting Drawables. Maybe instead of X vs O, it's the Rebels vs the Empire. You will need to use the API to find out what functions/attributes are available to you. Piazza is your friend as well.

Let the user(s) then play the game. If it is set for two players, then play alternates between X and O. If gameplay is set to one player, then after the user places an X, the computer should play. The computer can be VERY SIMPLE. Have the computer select a random free space to play. No need for complex AI that never loses (though you can add it if you like - here are some strategy tips).

When the game is over, display a message/Toast to the user with the outcome. Update the score and display the new score. Finally, present the user with two buttons to either:
  1. Play Again
  2. Go Back
Play Again should start a new game using the same gameplay options that were previously selected. Go Back should return to the Welcome screen. If the user chooses Go Back and then New Game, the score displayed on the screen should still be the same as when the last game ended.

Use the image below as motivation (but vary to make it much cooler looking):
Tic Tac Toe Star Wars


Part IV - Landscape Mode


Finally, create an appropriate landscape layout for when the screen is rotated (the game and options should all be accessible from either orientation). More importantly, you will need to save the state for every Activity when the screen is rotated. The user should have a seamless experience. This means: (1) options do not get reset (2) the score does not get reset (3) the game does not get reset. From the user's perspective, nothing should change and there's no way to cheat at the game.


Part V - Website!


Update the webpage that you submitted with Assignment1 to include an entry for this assignment. As usual, include a screenshot (or two) and a brief description of the program, intended to showcase what your program does to people who are not familiar with the assignment.


Documentation


With this and all future assignments, you are expeced to appropriately document your code. This includes writing comments in your source code - remember that your comments should explain what a piece of code is supposed to do and why; don't just re-write what the code says in plain English. Comments serve the dual purpose of explaining your code to someone unfamiliar with it and assisting in debugging. If you know what a piece of code is supposed to be doing, you can figure out where it's going awry more easily.

Proper documentation also means including a README.txt file with your submission. In your submission folder, always include a file called README.txt that lists:
  • Your Name / email
  • Assignment Number / Project Title
  • A brief, high level description of what the program is / does
  • A usage section, explaining how to run the program, which keys perform which actions, etc.
  • Instructions on compiling your code
  • Notes about bugs, implementation details, etc. if necessary


Grading Rubric


Your submission will be graded according to the following rubric.

PercentageRequirement Description
10%WelcomeActivity class and layout appropriately created.
10%OptionsActivity class and layout appropriately created.
10%GameActivity class and layout appropriately created. An image is used for pieces.
20%Each activity has a corresponding landscape layout. State is not lost during device rotation.
20%OptionsActivity started via Intent from WelcomeActivity. Result returned to WelcomeActivity.
20%GameActivity started via Intent from WelcomeActivity. Result returned to WelcomeActivity.
5%Source Code is documented with appropriate Javadoc style comments.
5%Submission includes source code, Android Studio project, and README.txt. Webpage named <userName>.html submitted and updated with screenshot from latest assignment. Submission compiles and executes.


Submission


Please make sure your project produces an executable with the name userName_A2. When you are completed with the assignment, zip together your Android Studio project (which includes the Java and XML source code), README.txt, and www/ folder. Name the zip file, userName_A2.zip. Upload this file to Blackboard under A2.

This assignment is due by February 8, 2016 by 2:59pm.

Last Updated: 01/01/70 00:00


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0