Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description of the program: In this section you will create a simple game. Players start at one end of a road that is 20 squares

Description of the program: In this section you will create a simple game. Players start at one end of a road that is 20 squares long. Each round the player rolls a dice and moves as many squares forward as the dice show. What cutscenes depend on what kind of route the player ends up in:

Normal Route: The player moves to the route and the turn goes to the next player Back to start: The player moves back to the start Obstacles: The player remains in the square the player was in before the dice roll

Sub-tasks:

A player wins if he or she reaches or passes the end of the road. The "Player" and "Dice" classes are awarded. Use the "score" property of the player to mark how far the player has come on the road.

a) Start by creating a class Route for custom route. All routes must have a move_hit method. This method should take a player object as a parameter. It is called when a player tries to move to the square. For custom route, move_hit should move the player to this route by updating the score property of the player to be the position of this route. The method should also return a string that contains a message that the player has been moved and to which route. b) Then create a class BackToStart for a route that causes the player to move back to the start. The move_hit method should set the player's score to 0. The method should also print a message about which route the player tried to move to (the position of this route) but that the player must move back to the start. c) Create a class Obstacles for a route that stops the player for this round. The move_hit method should print a message stating that the player is hindered and not move the player (the player stays where he / she was last d) Create a Python script that plays the game with one player. Make a road as a list of routes. Fill the list with a combination of the different types of route. There should be the most regular routes and the fewest jerks back to the start routes. e) Create a Python script that plays the game with multiple players. The program will end when a player has won. A player wins when he reaches either the end or past the end of the road.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago