turtle-graphics

How can I create multiple turtles all in different positions?

How can I create multiple turtles all in different positions? Question: I am trying to build a crossy road sort of game through the use of the turtle package but I’m stuck on how I can create multiple different turtles (cars) that will go across my screen all at different y values. This is literally …

Total answers: 2

how do i name turtles after a loops index and use them afterwards

how do i name turtles after a loops index and use them afterwards Question: i am trying to make a game using images as sprites where the 10 rocks papers and scissors float about killing each other tryign to make all of them one character but i want to make the turtles easily using an …

Total answers: 1

Draw polygon in polygons (regular polygons)

Draw polygon in polygons (regular polygons) Question: This is my code that draws regular polygons: import turtle tr = turtle.Turtle() tr.lt(150) for x in range(3,13): for i in range(x): tr.fd(80) tr.lt(360//x) turtle.done() This is my output: But my expected output is: Can you help me? Asked By: Roham || Source Answers: As already pointed in …

Total answers: 2

How to convert window coords into turtle coords (Python Turtle)

How to convert window coords into turtle coords (Python Turtle) Question: I am trying to create a program to move the turtle to where the mouse is. I am doing: import turtle t = turtle.Turtle() canvas = turtle.getcanvas() while True: mouseX, mouseY = canvas.winfo_pointerxy() t.goto(mouseX, mouseY) but the turtle keeps moving off the screen. I …

Total answers: 3

How to import png images Turtle Python

How to import png images Turtle Python Question: I cannot import png images into python turtle although I can add gif images. Can someone please answer this as quickly as they can. I tried just swapping to png from the gif, but no luck. Asked By: Urbro49 || Source Answers: The turtle module does not …

Total answers: 1

Need help making every petal on a flower a different color

Need help making every petal on a flower a different color Question: How do make every petal on a flower a different color? I tried doing this but it resulted in every flower petal being the same color. Im not sure how I can make every flower petal a different color. import turtle import random …

Total answers: 1

Python Turtle: How to do onkeypress to a function in another file

Python Turtle: How to do onkeypress to a function in another file Question: I have this issue in python turtle that when I attempt to do the onkeypress feature for a function that is in another file, nothing occurs. No error messages, no character movement. Nothing. File 1 (Player Function and Creating Sprite): class Player: …

Total answers: 2

How to interact with a turtle when it is invisible?

How to interact with a turtle when it is invisible? Question: I have been creating a game with turtle and I was going to make a the background change when a certain area is clicked. So I used a turtle and used the onclick() method when I realized that it did not look good with …

Total answers: 1

How to make the square have blue lines and be at the front of the green line?

How to make the square have blue lines and be at the front of the green line? Question: I want to make the square appear at the start of the green line and be blue. How do I do that? from turtle import * color(‘green’) begin_fill() forward(200) end_fill() import turtle turtle.color(‘blue’) # Creating a for …

Total answers: 1

Python turtle drawing glitch?

Python turtle drawing glitch? Question: I wanted to create a type of "grid" using turtle in python but when I start the program the parts of the drawing had a sort of broken line like this: Glitchy part This is the full image: Full drawing I don’t know is this a glitch or something wrong …

Total answers: 1