Questions tagged [turtle-graphics]

A method for drawing computer graphics using a cursor, known as a turtle. Turtle-graphics supports game development, visualizations, animation, etc.

A method for drawing graphics, which uses a cursor (known as a turtle) for specifying the position, the direction and the attributes (color, line width, etc.) of the lines being drawn. It was popularized by the Logo programming language. Similar functionality can currently be found in Python's turtle module, which is part of its standard library.

The turtle runs commands sent to it sequentially, including moving forwards or backwards, turning/rotating, and raising or lowering "the pen" determining if the turtle is currently drawing a line while moving. This output pathway of the turtle can additionally be post-processed into 3-dimensional models. Depending upon the implementation, the turtle may traverse 2D, 3D, or N-dimensional coordinate spaces.

3188 questions
3
votes
2 answers

Pick up pen when turtle is not at coordinate

My program draws images that already have coordinates attach to them. I want my turtle to be able to pick up the pen when not at the coordinate. Right now the turtle continues to write before getting to the coordinate. code: with open('output.txt',…
yemi.JUMP
  • 313
  • 2
  • 12
3
votes
1 answer

How to get the points of a bezier curve/parabola using 3 unique points on a graph

I'm trying to make a parabolic/bezier curve between two main points (using a third point as the control point) and cannot work out how to do it. from turtle import * pointA = (0.00,50.00) pointB = (0.00,350.00) pointC =…
lach993
  • 57
  • 1
  • 6
3
votes
4 answers

Turtle does not run more than once in jupyter notebook

I am trying to run some turtle code in jupyter notebook. When I run the code once, the code runs fine. However, if I run the code again, Python Turtle Graphics freezes and closes (aka python turtle graphics is not responding) and the jupyter…
Apollo199999999
  • 186
  • 3
  • 12
3
votes
1 answer

My turtle is not detecting inputs and it can just go past the border

So basically, I can't move my turtle at all, even though there are functions for it. And, when I could, when it hit the border it would just keep going. I've tried moving the position of the functions but it doesn't work. I have all the functions…
eran
  • 31
  • 1
3
votes
0 answers

Python Turtle not filling as per documentation example

I'm trying to show my daughter some code and thought turtle would be fun. I'm more of a numbers guy, but that's not much fun for kids. I'm having trouble reproducing the documentation example. This is more just bothering me because I can't figure…
Chris McL
  • 190
  • 10
3
votes
3 answers

how to add a def function with a while true loop

I've added a function definition to tell my turtle to jump when you press the space bar. There is also a while True loop in my code, and whenever the space button is pressed, the while True loop freezes momentarily until the jump is finished and…
leah
  • 31
  • 2
3
votes
4 answers

turtle.onclick() doesn't work as supposed to

I have a script for a simple turtle race and I want the race to start when the user clicks the left-mouse-button so i have this code def tur_race(): for step in range(0, 135): tur1.forward(randint(1, 5)) tur2.forward(randint(1,…
Amr Bashir
  • 103
  • 1
  • 2
  • 12
3
votes
5 answers

No module named 'turtle'

i am learning and trying to make a snake game in Python3 i am importing turtle i am using: Linux mint 19, PyCharm, python37, python3-tk Traceback (most recent call last): File "/home/buszter/PycharmProjects/untitled1/snake.py", line 2, in…
buszter
  • 39
  • 1
  • 1
  • 3
3
votes
1 answer

Python Turtle: Is it possible to use layers in fill command

I have recently been developing a software which will be used for creating fractal images. But I realized for it to fill the shapes it will need to be done in layers otherwise it will overwrite sections. Here is my current code: import turtle def…
Adam Wates
  • 35
  • 3
3
votes
2 answers

Stopping the execution of Python script

I have written this question after reading this question and this other one. I would like to stop the execution of a Python script when a button is pressed. Here the code: import turtle from sys import exit def stop_program(): print("exit…
Leos313
  • 5,152
  • 6
  • 40
  • 69
3
votes
1 answer

How to turn turtle graphic output into an image file?

I have been trying to figure out how to output a Python turtle graphic as an image. I have checked multiple threads and still cannot quite figure it out (i've tried to make a postscript file and convert it but no luck and also tried to put the…
wilfred202
  • 31
  • 1
  • 2
3
votes
2 answers

How do I run two turtles in python simultaneously?

I'm trying to make two turtles move together instead of one moving subsequently after the other. For example: a = turtle.Turtle() b = turtle.Turtle() a.forward(100) b.forward(100) But this only makes them move one after the other. Is there a way…
rasabi
  • 56
  • 1
  • 6
3
votes
2 answers

How to draw arc (part of circle) in python

I want to have 360 PNG bitmaps, each bitmap is an arc, and presents for a step in a progress. The following bitmaps present for step 60 (60 degree from top) and step 120. How to draw these bitmaps in code? Edit: I can draw it now but do not know…
Ngo Thanh Nhan
  • 503
  • 2
  • 5
  • 17
3
votes
1 answer

Python Turtle Space Invaders bullets not hitting invaders

I'm very new to turtle and python in general, so I apologize if my code seems messy. I'm currently coding a turtle version of space invaders and I can't figure out why my invaders aren't dying when they hit the turtles. The code seems to be the same…
Dino Crammer
  • 53
  • 1
  • 3
3
votes
2 answers

Repeating functions with python turtle

I wish to know way to make loop of function to recreate the same shape/pattern(google photo logo) with a different rotation and position and different variables such as color. Below is code that will allow me to make one of the pallets with the…
Bondspencil
  • 93
  • 1
  • 12