#Will Kern/Jericho Larson assignment 1 period 7 import turtle import random #random location of score box xRange = random.randrange(-150, 150) yRange = random.randrange(-100, 100) realX = xRange realY = yRange window = turtle.Screen() drawer = turtle.Turtle() #Turtle makes box def makeScore(x, y, turtle): #This makes the End Square turtle.hideturtle() turtle.up() turtle.goto(x, y) turtle.fillcolor("Black") turtle.begin_fill() for i in range(4): turtle.forward(50) turtle.right(90) turtle.end_fill() def score(turtleF, turtle_2): #Determines if you score or not global moves turtleF.color(random.random(), random.random(), random.random()) turtle_2.color(random.random(), random.random(), random.random()) turtlex = turtleF.xcor() turtley = turtleF.ycor() fontsize = random.randint(1, 100) fontsize_big = random.randint(100,100) turtleF.write("nope", move = False, align="left", font=("Arial", fontsize , "normal")) #ENHANCE if realX <= turtlex <= realX + 50 and realY >= turtley >= realY - 50: print("AAAAAAAAAAAAAAH")#ENHANCE window.clear() turtle_2.write("You win! it took you "+str(moves)+" moves!", move = True, align="center", font=("Arial", 35 , "normal")) #Win message moves = 0 makeScore(realX, realY, drawer) #User Stuff moves = 0 runner = turtle.Turtle() #Users Turtle runner.speed(0) runner.up() runner.shape("turtle") def east(): #Turtle goes right global moves runner.setheading(0) runner.forward(50) score(runner, drawer) moves = moves+1 def north(): #Turtle goes up global moves runner.setheading(90) runner.forward(50) score(runner, drawer) moves = moves+1 def west(): #Turtle goes left global moves runner.setheading(180) runner.forward(50) score(runner, drawer) moves = moves+1 def south(): #Turtle goes down global moves runner.setheading(270) runner.forward(50) score(runner, drawer) moves = moves+1 #Keyboard Commands window.onkey(east, "Right") window.onkey(north, "Up") window.onkey(west, "Left") window.onkey(south, "Down") window.listen()