Program Specifications Design a multiplayer game where the p
Program Specifications
Design a multi-player game where the players can attack one another and the objective is
to be the last to survive. Each player starts with 100 health points, which are reduced
every time a successful attack takes place. A player has a condition, which is based on the
number of health points he possesses. Te table below shows the condition that
corresponds to the number of health points.
100 excellent 50’s very poor
90’s very good 40’s terrible
80’s good 1 – 39 critical
70’s average 0 dead
60’s poor < 10 Zombie
When the program starts, it asks for the number of players and the name of each player.
Each player gets a turn, and turns go round-robin. Only players who are still alive or
have been turned into zombies can continue to play. When a player gets a turn, he is
asked for the name of the player to attack. Players are not allowed to attack themselves,
and if they try, they forfeit their turn. After each turn, display the condition of all players
who are alive or have been turned into zombies.
When a player attacks another player, the program should generate a random number
between 0 and 20. If the value falls between 0 and 9, the attack is considered a “miss” and
the opponent suffers no damage. Otherwise, decrease the health of the player who’s been
attacked by the value generated. After an attack, display the outcome. If, after an attack,
a player’s health falls anywhere between 0 and –10, the player is dead and the game is
over for that player. If, after an attack, the player’s health points fall below 10, the player
turns into a zombie. For example, if a player has 5 health points remaining and someone
attacks him and inflicts 18 points of damage, the health points fall to –13. Since that is
below –10, that player morphs into a Zombie.
Zombies are very difficult to kill — they cease to exist only after their health score falls
below –100. Zombies are also lethal. Te more players they kill, the more powerful they
become. When calculating the damage a Zombie inflicts on an opponent, generate a
value between 0 and 20 and multiply it by the number of kills that Zombie has made.
Inflict that amount of damage on the victim. For example, a Zombie has killed three
players and attacks a fourth. Suppose the randomly generated value is 10. Te victim
suffers 10 x 3 = 30 points of damage. Furthermore, Zombies do not miss. Any value
between 0 and 20 is used against the opponent. For example, if a Zombie attacks another
player, they’ve already killed 2 players, and the randomly generated value is 5, the
Zombie will do 2 x 5 = 10 points of damage to their opponent.
Te program should never reveal the actual number of points a player loses as the result
of an attack. Te only way of gauging the impact of an attack is by looking at the
condition of the player. Te game is over when one player is left and is not a Zombie or if
all the players that remain have become zombies in the course of the game, in which case
the last zombie standing wins the game.
Implementation
Use an object-oriented design methodology for this program. Create a class named
Player that has the characterstics shown in the UML diagram to the left. Build a
constructor for the class so that, when a Player object is created, the health for that
player is set to 100. Te name of the Player should also be passed into the constructor
and assigned to the name field within the class.
Te get_condition() method returns a
String, i.e. the condition as determined by the
chart on the previous page. It should not return
or indicate the actual number of health points.
Te is_alive() method should return TRUE if
the health is above 0 and FALSE if not. A
zombie is considered dead when his health score
falls below –100 (negative one-hundred) points.
Te attack() method should implement the algorithm described on the previous page.
Within the method, inform the users of the results of the attack. Te opponent
parameter should be declared as a Player object. If the result of the algorithm calls for
inflicting damage on the opponent, the program should call the inflict_damage()
method, passing in the value determined by the algorithm.
Create another class with a main() method that drives the program. Tis method should
begin by asking how many players there are. It should then create an ArrayList of
Player objects, followed by a loop that continues to run until only one Player is left
alive or one Zombie is left after the game had only zombie players left in rotation.
You have the freedom to implement the user interface anyway you’d like, whether it be a
graphical interface or strictly text-based. Whichever route you take, the most important
factor is the clarity you provide the user in terms of instructions for game play and the
readability of the output. Te game should be easy to play. Each turn should be clearly
indicated on the screen, and text should not run together and be difficult to split into
functional sections.
Project Assessment
Your program must be implemented in one file. Include a comment block that states
your name, the program title, the date it was created, and a brief description of the
application. Troughout the program, you should add comments where you believe
they would aid in comprehension of the code for someone not unfamilar with it.
Use the programming constructs you’ve learned throughout the semester. Tink
carefully about what constructs to use, since effenciency is part of your grade. For
example, if you need to execute a few statements ten times, you can paste them in ten
times, or you can write a loop. If you paste them in, you will lose points for not choosing
the more efficient solution. Likewise, if you create fifty variables instead of using an
array, you will lose points for not choosing the most appropriate language structure.
Your grade for this project will be determined using the criteria listed below:
1. Functional Requirements
2. User Experience
3. Code Craftsmanship
Te first criterion is simply if the program works according to the requirements stated. If
I can run the program and I get the right data, and if the input is validated, you will have
fulfilled this criterion.
Te second criterion looks at how easy and intuitive your program is to use from the
user’s perspective. Te user should be given clear instructions and know exactly what to
do at all times; he (or she) shouldn’t have to think very hard about what he’s doing.
While this criterion is more subjective than the first, you can be confident I will evaluate
your program fairly and accurately. I have spent over twenty-five years as software
developer, and over that time I have evaluated thousands of programs. So I know what
constitutes an intuitive program versus one that is not.
Te third and final criterion addresses the quality of your work as a software craftsman. I
will be making judgments on
• how easy the code is to understand
• whether or not it is adequately documented
• how effectively the code is divided into functions in order to minimize duplication,
promote reuse, and simplify the code overall
• whether the best programming construct, methodology, or syntax is used to
accomplish a given functional task in the code
• whether appropriate, consistent naming conventions are used when naming
variables, classes, and functions
• appropriate and consistent indentation and spacing is used within the code
Tese criteria will be weighted as follows:
Solution
Here I would like to answer this questieon!!!
We have seen number of childrens, elders and parents and many of them play games in the system via online or else through the disks where in many of them play the games in what they like. Here in the questieon asked about lives. In many of the games we see the palyer gets only some lives to complete the game.
Meanwhile because of the games in which about the lives to complete a game or level, an object or the act of gaining an extra life. There are some different terms used for the playing of games they are
For one player its like 1-up asusual for second player it was 2-up
1 verses 1 means two players batting against each other


