• shooter_clicked(x,y): This function is called when the shooter turtle is clicked on the screen. If the bullet not already moving, this function sets a global flag to cause the bullet to start moving upward.
• Set the window dimensions and title. Call setup() to draw the window.
• Set random x and y coordinates for the ball using random.randrange().
• Create the ball as a new blue, circular turtle. Set penup(), and move the ball to its starting location in the window.
• Set the x and y movement increments for the ball to 5.
• Draw the shooter image on the screen with the “shooter” turtle. Make it a red square positioned at the bottom middle of the screen.
• Create the “bullet” turtle as a black circle, and draw it on the screen sitting on top of the shooter turtle.
• Set the bullet_moving flag to False to indicate that the bullet is not moving yet.
Inside the while-loop you can use the bouncing ball code from bouncing_ball.py. Then add code to the while-loop to do the following:
• If the bullet is also moving, move it to its new position.
• If the bullet is close to the moving ball (use turtle.distance() to check the distance), end the game and the while-loop.
• Congratulate the player for winning the game.
Edited 3 Years Ago by mike_2000_17: Fixed formatting