Question: Complete in Python!!!! This assignment has you building some basic components of a video game Write a script that has the following: Three classes: A
Complete in Python!!!! This assignment has you building some basic components of a video game
Write a script that has the following:
- Three classes: A Player class, a RedPlayer class, and a BluePlayer class. RedPlayer and BluePlayer should be subclasses of Player.
- All players should have a name and a position represented by a number. The position represents how many miles they are along a trail.
- Both a RedPlayer and a BluePlayer can walk with a walk() function. When a RedPlayer walks, they should move forward between 1 and 10 steps. A BluePlayer should move forward between 2 and 6 steps. The actual number of steps should be randomly generated within the given range.
- The Player class should have a list of all players called playerList
- The main script should ask the user how many red players they want and how many blue players. For each player, the user should give that player a name.
- Then, the script should have all players walk until a player gets to 100 miles (or further). Announce that player as the winner.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
