Question: The link to the code is https://pastebin.com/0zJYcaKV all i need is to add an ending saying the score and if you won or lost and

The link to the code is https://pastebin.com/0zJYcaKV all i need is to add an ending saying the score and if you won or lost and then close the turtle.

if the game is ended by the ball going off the bottom of the screen the function will need to write something like "You Lose" and then the score in the center of the screen

if the game is ended by the player destroying all the blocks the function will need to write something like "You Win!" and then the score.

The function will also need to set the global gamestart to false

It would look similar to this

def gameend(score,end):

writer = turtle.Turtle()

writer.hideturtle()

writer.setpos([wherever you want to write])

global gamestart = false

if end == "blocks"

writer.write("You lose! score:"+score)

if end == "offscreen":

writer.write("You win! score:"+score)

I already have the code for the game I just need the ending to show if you won or lost and for it to end all in python turtle.

If you have any other questions I will help. Just am confused about how to make the end of the game to show if I lost or won! need to create it in python and also have it as two parameters for the score to show and also how the game will end

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 Programming Questions!