Question: Write a program in Python: Start your program by asking the user how many players he/she would like to create. Only allow 1-8 players (note,
Write a program in Python:
- Start your program by asking the user how many players he/she would like to create. Only allow 1-8 players (note, this must be an integer). Ask the user for all player names. Create each player with lvl = 1, hp = 100, at = 10, df = 5, exp = 0. Store all players in a list.
- Create a Boss (named "Boss") that has HP equal to 20 times the number of players. If 3 players were created in part 1, then the Boss should have HP equal to 60. The level should be 1, attack should be 100, defense should be 0, and exp should be 0.
- The Boss first spawns a Minion. Store all Minions in a list.
- The program will loop and ask for each (alive) player's move. Use a list to keep track of alive players. Players can choose which Minion to attack. Use a list to keep track of the alive Minions. Players cannot attack the Boss until all Minions are gone.
- All Minions (if any) will attack the player with the lowest HP. If there are multiple players with the lowest HP, the Minions will attack the latest created player (so Player 8 if there are 8 players with the same HP).
- Repeat Steps 3 through 6 until the boss has been defeated or all players have been defeated.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
