Assignment 7: Word Game Part 3: Two Player Communication
This is an individual assignment.
This is the first part of an assignment where you enhance your word game to have two player capability (and for 5520 students, some additional sensor capability). In this part of the assignment, you will write the code you need to make a robust Android program that puts/gets information to the Internet and sends notifications to support a multi-player, asynchronous and synchronous game play.
You will need to both design and implement a two-player version of Dabble. You will need to be creative and use some of the rapid design techniques we have discussed and read about in the class. The more you work out your design carefully in advance, the easier the programming will be. Just for emphasis, the more you work out your design carefully in advance, the easier the programming will be. As discussed in class, your app design and the complexity of programming that app are linked.
Your first goal is to enhance the design of your game. After reading Assignment 9:
- Enhance the design of your game so that two players can play against each other both synchronously and asynchronously on two different phones. You will have to design the game play for this... there are a variety of ways to do it. Some may be more usable and fun than others. Your game design must have the following features:
- You must allow real-time play. When one player makes a move, the other player must get a message about that move as quickly as possible on the game board, and certainly in interactive time. It should be obvious that both people are playing together in some way.
- You must allow asynchronous play. If someone is not actively playing the game (i.e. the game board is not visible) but the opponent makes a move in some way, then the player should be notified that something happened or it is his/her turn. Use the notification bar. Clicking on any notification should start the app on the phone and go to the appropriate Activity where the player can make the next move.
- In both cases, you need to make sure two players playing at the same time can clearly understand what the opponent is doing. The players must clearly be playing against one another using the same (or somehow related) Dabble boards. There are many ways you can achieve this, and there are many examples on the Play Store of word games that permit both asynchronous and synchronous play.
- Enhance the design of your game to include a top scorer list that shows the name of the top scorer, the score, the time/day the score was achieved, and anything else you think important or fun for the list. This list should be shared between all players.
- Enhance the design of your game so that a user can install the game on one phone and easily find a particular player who has installed the app on another phone and start a game.
- If needed to explain the two player game, enhance the design of your game with a tutorial or rules screen that explains the rules in your new two-player modes of the games.
- Ensure that the single player option remains available.
In no more than two pages, using screen sketches and a storyboard explain how your design for a two player game will work. We should be able to read this description and understand how you plan to design the synchronous and asynchronous two player modes. For students in 5520, this design should also clearly explain how sensors will also be used in the two player game.
Next, start programming.
- Fix any remaining bugs from prior assignments in the one-player version of the game.
- Without being too concerned about the graphics, implement test code that proves beyond any doubt that you have worked out the app-to-app communication you will need to implement your design. In particular, have test code that demonstrates the ability to:
- Easily find and connect up with another player of the game
- Connect to that person and send data back and forth quickly between games
- See information about the moves another player is making as that player uses the single player version of the game
- Save and get information contributed to a central place on the server (e.g., high score info)
For this assignments, you do not need to work on the graphics or the actual two-player interaction and game play. You just need to demonstrate that you have worked out the app-to-app communication strategy and the storage of data remotely, and that it works robustly.
You are free to store data on the web using whatever method you wish. To assist you, we will provide a simple server service that will allow you to get/put string/value pairs to our server that is very similar to accessing data using a SharedPreference object. [Information can be found here].
Important topics to consider:
- Any web call can be very slow. You must implement any web calls on a separate thread (e.g., using AsyncTask).
- Any web call can fail. Your app must do something reasonable if the Internet is not available.
- Your game should not require a live Internet connection to play (although clearly it requires an Internet connection to play in synchronous mode).
- Your game will need to allow two people on two different phones to (easily!) start a game together.
- You want to keep the data you store "in the cloud" as simple as possible and focus on the phone code. Although in a commercial app of this sort you might have a server-side database, you do not need such complexity for this assignment! You can assume only a handful of people will be playing your game.
Your assignment should be added to your existing app on the Play Store. Add a new button on your apps initial screen, "Communication", which will start your game and have the test code included. As in other assignments, do not add a new icon and launcher, and your previous assignments should still function. Your app should then have 7 buttons: About, Generate Error, Sudoku, Dictionary, Dabble, Communication, and Quit. Your app should be available on the Play Store by the assignment deadline, and your Git repository should be up to date with your code (and easily buildable from scratch should we need to download it and compile your project).
As you complete this assignment
and have “aha!” moments where you figure out tricky things that might hold other
people up, you should help out your classmates on Piazza.
If special instructions are needed for us to see how to test your code, please provide them in your write-up.
You will be graded based on how
well you demonstrate that you have worked out the app communication (testing your code) and evidence that you have thought through all aspects of how to design your two-player modification to the game (reading your write-up).
Email the written part of this assignment with the subject line "Assignment 7" to Mansoor and ...@neu.edu as a PDF file named [YourFirstName][YourLastName].assign7.pdf by the deadline.