Answered step by step
Verified Expert Solution
Question
1 Approved Answer
working on Milestone 2 for this client server hangman game in java: Milestone 2 : The concept of Payloads will continue to be utilized Base
working on Milestone for this client server hangman game in java:
Milestone :
The concept of Payloads will continue to be utilized
Base Payload for applicable items that only need client id message, and type
PointsPayload for syncing points of players
Each payload will be presented by debug output
On session start ie after ready check
GameRoom loads the word list into memory from a text file for later use
On round start randomly pick word from list to guess
The correct word is chosen and removed from the inmemory list
The blanks are shared with all players
The strikeshangman resets
Trigger Turn Start
On Turn Start
Pick next Player
Initially random, then roundrobin
GameRoom Turn timer begins
During the turn
Clientside commands will process the users intention
Note: Commands will extract the data, wrap it in a Payload or subclass and pass it to the ServerThread
Note: ServerThread will interpret the payload, extract the data, and pass it to the necessary GameRoom method
Note: GameRoom will do the actual command process
Note: The Client initiating the command will see the original message
guess word
GameRoom will check against the correct word
If it matches exactly
The guesser will receive points for each missing letter and bonus points for solving x points for each empty space
Points will be stored on the Player object
Sync the points value of the Player to all Clients
A message will be relayed that X guessed the correct word word and got points points
The round should end
If it doesnt match
A strike will be incurred and synced to all Clients
A message will be relayed that X guessed word and it was wrong
Their turn should end
letter letter
GameRoom will check the occurrences of the letter that havent been guessed this round
If any matches
The guesser will receive points for each slot the letter appears in if its not been previously guessed for this word
I.e points times number of matched letters
Points will be stored on the Player object
Sync the points value of the Player to all Clients
A message will be relayed X guessed letter and there were numberletters which yielded points points.
Their turn should end
If no matches,
A strike will be incurred and synced to all Clients
A message will be relayed X guess letter letter, which isnt in the word
If strikes reach the limit the round ends
If strikes dont reach the limit the current Players turn ends
skip
Skips the players turn if its their turn
Ends their turn
On turn end
Condition : Turn ends when Player guesses a letter or word
Condition : Turn ends Turn Timer expires
Condition : Turn ends when the current Player Skips their turn
Trigger turn start logic if session end condition not met
On round end
Condition : Round ends when word is completed
Condition : Round ends when Hangman Strikes reach limit
Send the inprogress scoreboard to all clients sorted by highest points to lowest
For this milestone itll just be a basic message
Trigger round start logic if session end condition not met
On session end
Condition: Session ends when X rounds have passed
Send the final scoreboard to all clients sorted by highest points to lowest
For this milestone itll just be a basic message
Include a game over message
Reset the player data for each client serverside and clientside do not disconnect them or move them to the lobby
A new ready check will be required to start a new session
I have many of the files just edits on where to make them is confusing
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started