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:

  1. Three classes: A Player class, a RedPlayer class, and a BluePlayer class. RedPlayer and BluePlayer should be subclasses of Player.
  2. All players should have a name and a position represented by a number. The position represents how many miles they are along a trail.
  3. 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.
  4. The Player class should have a list of all players called playerList
  5. 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.
  6. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!