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
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