rs to a growing word fragment. The letter you select should attempt to force your opponent to spell a word or create a word fragment that has no possibility of creating a word. Unlike the prior ghost competition, when it is your turn you are allowed to add a letter to either the front or back of the word fragment. Winning Criteria: If your opponent spells a word that is at least 6 characters long
Super Ghost Project
Rule changes:
The premise of the game remains the same, there are two players adding words to a growing word fragment. Each player will take turns attempting to add letters to a growing word fragment. The letter you select should attempt to force your opponent to spell a word or create a word fragment that has no possibility of creating a word. Unlike the prior ghost competition, when it is your turn you are allowed to add a letter to either the front or back of the word fragment.
Winning Criteria:
If your opponent spells a word that is at least 6 characters long
if your opponent creates a word fragment that has no possibility of creating a word
if your opponent takes longer than 60 seconds to select a word.
Tip: If you are the first player you can only spell words that are odd length thus you can only lose when you spell words that are odd but you can win when your opponent spells words that are even length. Accordingly, if you are the first player you should only care about spelling even length words. You can tell if you are the first player by the length of the word fragment when it is your turn...
Programmatic Requirements:
The minimal requirement for this project is that you build a program that can save and load the share game data file with a GUI that enables you to control your team's actions. The GUI must contain a text field that displays the most current word fragment for each given round, it should update at the beginning of each round. It must also contain a text field where you can type in your next letter as well as some type of interface where you select the location the next letter should be placed in the fragment. Please use the accompanying photo as an example. Given that a portion of your grade is based on how well you perform in the competition it is highly recommended that you implement some type of assistance letter selection
Programmatic Changes:
Not much has changed the SGhostApp.jar will be used to start you and your opponent's program. SGhostApp.jar will act as the game arbiter that will stop the game if one of the winning criteria is met as well as notify either team of their turn to play by changing the game state in the shared game file. Below you will find documentation on the programmatic changes.
TurnData:
This object holds information about the letter and location you intend to play. You will create this object in your button listener using the user inputted information from the text field as your letter and a particular button as the location. You create this class using the Turn Data's static function named "create". This function accepts three parameters, they are as follows: your application's team name, a character denoting the letter you intend to play and a boolean value signifying if you would like to add the letter to the front of the word or not (True = Front and False = Back).
Letter Selection:
Since we now have the ability to add letters to the front and back of the word fragment your old logic of searching for words in your dictionary that start with the fragment will only partially get the job done. You must now look for words that contain the fragment.
File I/O
We will not be writing to a text file like in the prior competition we will be writing to a binary file. The binary file will contain the class called ShareGameData.java. This class holds a list of GameActions and GameState. Use your IOManager to read and write to this file.
GameActions
This class holds each player's action for each given turn. The action holds the letter that was played, the location where the letter was added, and the team the made the action. The game actions are stored in sequential order in the action record list of the ShareGameData class. Every time you play a new letter you will create a new GameAction and add it to the ShareGameData's action record, then you will save the file.
GameState
This class holds information about the current game's state. This class is used to figure out if the game is over and who's turn it is. You should never change the values in this class. You should only be reading these values. This class will be changed by the GhostApp (The game arbiter)
Project Organization (MANDATORY)
Any class that implements serializable must be put in a package called "sharedCode". Failure to do this will lead to a classNotFoundException being thrown by your IOManager when you attempt to read the sharedGameData file. The classes that must be put in the package named "sharedCode" package include: AddLocation.java, GameAction.java, GameState.java, and SharedGameData.java.
WARNING: You should not change any of the files that implement serializable!
What do you have to do?
- Initialize your File Manager, Dictionary, IO Manager and Turn Parser in the Ghost Skeleton Class.
- Implement the GameManager's constructor, onTurn and updateGUI method in the GameManager class. (See details below).
- Create a jar file.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps