Lab 8

Grid Game is now networked!
We can play multi-player games over the internet.

Activity

  1. Modify TTT to use a background. Here is a sample: night_stars.jpg
    When the game starts, all the cells will be empty. Display an empty cell as an inverse video plus sign.
  2. Invent some logic that allows someone to win, such as the first person to click in the lower right hand square. Show "You Win" or "You Lose" dialog appropriately.
  3. Put winner name and date in high scores text file.
  4. Modify the game rules so that each cell has a point value. For example,
    1  2  3
    4  5  6
    7  8  9
    
    Modify the status message to show "Score X:Y. Your Turn"
    where X is your score and Y is the opponent's score. (The opponent's score should be obtained from the opponent via event messages).
  5. Can you modify the plugin so that the player who starts a new game gets to choose the board size from the Preferences dialog, and then that size board is used by BOTH players?

Resources

NetworkConnection.java (V1.0)

To start a server: bin/server.sh

To compile and run your plugin,
cd plugins
javac ..:. *.java
cd ..
bin/client.sh
To connect to your local server, select the default host "localhost".
Then open another terminal window, and start a second client running with a different username.

Submission

Demonstrate your completed program to the instructor.
Create a zip file containing the plugins folder and the TTT folder.
Submit the zip file via handin to the "Lab8" folder.

If you have time, you can begin the next activity, which is to implement an AI client for TicTacToe.