Python Forum

Full Version: I am trying to make a Colour Wars game, "Winning code" missing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can somebody help? The goal of the game is, that you have a turtle, that you control with arrows, and the turtle paints down color as it moves. How you win - you fill up the whole screen with your color, and that is the part of the code, that I don' have. python Code:
import turtle
import math
        
troncycle = turtle.Turtle()
screen = turtle.Screen()
troncycle.pensize(75)
troncycle.color("dark blue")
troncycle.pencolor("blue")
turtle.setup(500, 500)

troncycle.penup()
troncycle.left(180)
troncycle.forward(25)
troncycle.pendown()

def moveright():
    troncycle.right(90)                
                
def moveleft():
    troncycle.left(90)
                                                    
for i in range(100000):
                           
    troncycle.forward(2)   
  
    screen.listen()
                  
    screen.onkeypress(moveright, "Right")
    screen.onkeypress(moveleft, "Left")