Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON So i need help programming, so that each ring scores points (including the bullseye) when the user hits the target in different rings. Points

PYTHON

So i need help programming, so that each ring scores points (including the bullseye) when the user hits the target in different rings. Points for each ring when the arrow is land on any of the rings.. Also how do i change the target to a circle instead of a square so that the hit area is matched with the bullseye in size and shape (Adjust the hit area to match the bullseye in size and shape).... This is what i have so far!!!!

import turtle

# SCREEN_WIDTH = 600 SCREEN_HEIGHT = 600 TARGET_LLEFT_X = 0 # TARGET_LLEFT_Y = 0 # TARGET_WIDTH = 25 # FORCE_FACTOR = 30 # PROJECTILE_SPEED = 1 # NORTH = 90 # SOUTH = 270 # EAST = 0 # WEST = 180 # BULLSEYE_RADIUS = 20 RING1_RADIUS = 350 RING2_RADIUS = 300 RING3_RADIUS = 250 RING4_RADIUS = 200 RING5_RADIUS = 150 RING6_RADIUS = 100

# turtle.setup(SCREEN_WIDTH, SCREEN_HEIGHT) turtle.speed(0) turtle.hideturtle()

# turtle.penup() turtle.goto(0, -RING1_RADIUS) turtle.fillcolor('blue')# turtle.pendown() turtle.begin_fill() turtle.circle(RING1_RADIUS) turtle.end_fill()

# turtle.penup() turtle.goto(0, -RING2_RADIUS) turtle.fillcolor('yellow') turtle.pendown() turtle.begin_fill() turtle.circle(RING2_RADIUS) turtle.end_fill()

# turtle.penup() turtle.goto(0, -RING3_RADIUS) turtle.fillcolor('green')# turtle.pendown() turtle.begin_fill() turtle.circle(RING3_RADIUS) turtle.end_fill() # turtle.penup() turtle.goto(0, -RING4_RADIUS) turtle.fillcolor('black')# turtle.pendown() turtle.begin_fill() turtle.circle(RING4_RADIUS) turtle.end_fill()

# turtle.penup() turtle.goto(0, -RING5_RADIUS) turtle.fillcolor('orange') turtle.pendown() turtle.begin_fill() turtle.circle(RING5_RADIUS) turtle.end_fill() # turtle.penup() turtle.goto(0, -RING6_RADIUS) turtle.fillcolor('white') turtle.pendown() turtle.begin_fill() turtle.circle(RING6_RADIUS) turtle.end_fill()

# turtle.penup() turtle.goto(0, -BULLSEYE_RADIUS) turtle.fillcolor('red') turtle.pendown() turtle.begin_fill() turtle.circle(BULLSEYE_RADIUS) turtle.end_fill()

# turtle.hideturtle() turtle.speed(0) turtle.penup() turtle.goto(TARGET_LLEFT_X, TARGET_LLEFT_Y) turtle.pendown() turtle.setheading(EAST) turtle.forward(TARGET_WIDTH) turtle.setheading(NORTH) turtle.forward(TARGET_WIDTH) turtle.setheading(WEST) turtle.forward(TARGET_WIDTH) turtle.setheading(SOUTH) turtle.forward(TARGET_WIDTH) turtle.penup()

# turtle.goto( -270, 270) turtle.setheading(320) turtle.showturtle() turtle.speed(PROJECTILE_SPEED)

# angle = float(input("Enter the projectile's angle: ")) force = float(input("Enter the launch force (1-10): "))

# distance = force * FORCE_FACTOR

# turtle.setheading(angle)

# turtle.pendown() turtle.forward(distance)

# if (turtle.xcor() >= TARGET_LLEFT_X and turtle.xcor() <= (TARGET_LLEFT_X + TARGET_WIDTH) and turtle.ycor() >= TARGET_LLEFT_Y and turtle.ycor() <= (TARGET_LLEFT_Y + TARGET_WIDTH)): print('Target hit!') else: print('You missed the target.')

# print('Welcome to the game of darts.') print('How many feet away from the target are you standing?') distance = int(input('Minimum = 6, maximum = 12: ')) print('How much force will you use to throw the dart?') force = int(input('Minimum = 1, maximum = 50: '))

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

More Books

Students also viewed these Databases questions

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago