With this code if i add another turtle (rectangle shaped) how do i get it to where its at the bottom of the screen and how do i make it to where if the ball hits the rectangle the game stops
Boost de Python code is import turtle#import the turtle module.It is a turtle is a pre-#installed Python library that enables users to create #pictures #and shapes turtle shape("circle")#This function is used to set the turtle shape #as circle xdir = 1#Initialize the value of xdir as 1 ydir = 1#Initialize the value of ydir as 1 x = 1#Initialize the value of x as 1 y = 1#Initialize the value of 7 as 1 wn=turtle.Screen()#This function returns a singleton object of a #TurtleScreen subclass wn.bgcolor("pink")#set the background color as pink while True:#While loop used for working the below steps continuously * = x + 3 * xdir# In each loop increment the value of x by x + #3xdir y = y + 3 * ydir# in each loop increment the value of y by y + #3ydir turtle.goto(x, y)#This method is used to move the turtle to an #absolute position. if x >= turtle.window_width()/2:#check the condition #x>sturtle.window_width()/2 then xdir = - 1#Assign the value of xdir as-1 if x = turtle.window_height()/2:#check the condition y >= #turtle.window_height(1/2 then ydir = -1#Assign the value of ydir as -1 if y = turtle.window_height()/2:#check the condition y >= #turtle.window_height()/2 then ydir = -1#Assign the value of ydir as -1 if y = turtle.window_width()/2: tcheck the condition x=turtle window_width 12 then xdir --#Assign the value of xdir as -1 * -turtle.window_width()/2:#check the condition xc -turtle window_width 0/2 then xdir = 1 Assign the value of xdir as 1 11 y turtle window_height()/2: check the condition y turtle.window_height0/2 then ydir = -1#Assign the value of ydir as -1 if y-turtle.window_height()/2=check the condition ys-turtle.window_height 1/2 the ydir - 1 Assign the value of ydir as 1 turtle.penup() This method used for pull the pen up. That is no drawing when #moving the shape turtle.mainloop() # This method used to wait for user to close window Boost de Python code is import turtle#import the turtle module.It is a turtle is a pre-#installed Python library that enables users to create #pictures #and shapes turtle shape("circle")#This function is used to set the turtle shape #as circle xdir = 1#Initialize the value of xdir as 1 ydir = 1#Initialize the value of ydir as 1 x = 1#Initialize the value of x as 1 y = 1#Initialize the value of 7 as 1 wn=turtle.Screen()#This function returns a singleton object of a #TurtleScreen subclass wn.bgcolor("pink")#set the background color as pink while True:#While loop used for working the below steps continuously * = x + 3 * xdir# In each loop increment the value of x by x + #3xdir y = y + 3 * ydir# in each loop increment the value of y by y + #3ydir turtle.goto(x, y)#This method is used to move the turtle to an #absolute position. if x >= turtle.window_width()/2:#check the condition #x>sturtle.window_width()/2 then xdir = - 1#Assign the value of xdir as-1 if x = turtle.window_height()/2:#check the condition y >= #turtle.window_height(1/2 then ydir = -1#Assign the value of ydir as -1 if y = turtle.window_height()/2:#check the condition y >= #turtle.window_height()/2 then ydir = -1#Assign the value of ydir as -1 if y = turtle.window_width()/2: tcheck the condition x=turtle window_width 12 then xdir --#Assign the value of xdir as -1 * -turtle.window_width()/2:#check the condition xc -turtle window_width 0/2 then xdir = 1 Assign the value of xdir as 1 11 y turtle window_height()/2: check the condition y turtle.window_height0/2 then ydir = -1#Assign the value of ydir as -1 if y-turtle.window_height()/2=check the condition ys-turtle.window_height 1/2 the ydir - 1 Assign the value of ydir as 1 turtle.penup() This method used for pull the pen up. That is no drawing when #moving the shape turtle.mainloop() # This method used to wait for user to close window