Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write code using python. The player's name. So that we can include the player's name when we display (print, for now) the score, we will

image text in transcribedimage text in transcribedimage text in transcribed

Write code using python.

The player's name. So that we can include the player's name when we display (print, for now) the score, we will store it as an attribute of the class Its value should be provided as a parameter to the class constructor, and is expected to remain the same throughout the lifetime of the object The current score. Our Score class won't be very useful to the game if it doesn't keep track of how many points the player has. The number of lives remaining. Another score-related concept is how many lives a player has remaining The current level. As players advance through a game, it gets more difficult. Higher levels indicate more difficulty. Although you can imagine many ways to do this, for us the level will simply be function of the current SCOre The current multiplier. Many games (including ours) have a concept of a multiplier. One common implementation of this is that if you do an action very well a certain number of times in a row, then the multiplier increases. Perhaps in a music game you hit five consecutive notes exactly on time. This might bump your multiplier to 2x, and then any points you earn while the multiplier is at that level are doubled before being added to your score. Usually, any mistake at all resets the multiplier to 1x. Some important points to consider are the following: Levels are achieved at the following scores. Note the exponential relationship between the level and the score range. Specifically, consider the value of 2 where x is the current level. Multiply that by 10000, and you have an exclusive upper bound for the score range for level x. While it is possible to compute this in closed form, I suggest you use this opportunity to gain more experience with loops in Python. When the score is changed, modify the value of the level attribute inside of a loop until it corresponds to the current SCOre o 0-9999 evel 0 o 10000-19999 level 1 o 20000-39999 evel 2 o 40000-79999 evel 3 o and so on

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

how would you have done things differently?

Answered: 1 week ago