Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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