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
0
votes
1 answer

Python program freezes (using pandas and turtle modules)

The problem is my program freezes and I can't find what's wrong: I've being re-reading the code over and over, I've searched here and I've also googled and couldn't find a reason. I've seen a theme where the program of one coder froze because of an…
0
votes
1 answer

How to create multiple 50 pence coins

How can I create separate coins in a page that are not overlapping or not touching each other. The code below shows overlapping coins if the number is greater than 2. import turtle tegan =…
0
votes
1 answer

Turtle slowing down for larger drawings

I have created some code in order to simulate sierpinski's triangle. For this, in my code, I set it so that it can simulate any number of points on the triangle, but I've noticed that increasing this to a large number, it ends up with the turtle…
Treyara
  • 47
  • 1
  • 7
0
votes
2 answers

Python won't run and says its unreferenced var

The error message is: File "d:\import turtle.py", line 29, in player_animate attackangle = (math.atan(ey/ex)/(2* math.pi))*360 UnboundLocalError: local variable 'ey' referenced before assignment I've tried rearanging the events of it here is…
0
votes
0 answers

bugs in python turtle module when using random module with it

import random from turtle import * # Screen Screen() title("Eid Mubarak !") window_width() window_height() bgcolor('black') hideturtle() speed(0) def Star_turtle(x, y): # Star import random penup() goto(x, y) colour =…
SpiderX
  • 1
  • 1
0
votes
1 answer

Draw a line chart based on user input

Please help me to draw a simple line chart in python turtle module based on user input. I am able to draw the x and y axis. The x-axis tick is equal to the number of data points. For example, if the user input is 5 then it will be 5 ticks labelled…
0
votes
1 answer

Why does Python turtle not exactly follow a grid?

I stumbled on this fact while working on a separate program I am writing, and am curious about why it happens and whether there is a way to stop it happening. The code below is for a simple program to illustrate this. The turtle initially seems to…
0
votes
1 answer

Hi guys! I made a non iterate (able) function using turtle and key presses, and I can't call the function. How do I fix this?

The first function calls to make the tic tac toe board, and the code before creates the screen and turtle. #import needed modules import turtle #make a screen ttts = turtle.Screen() #set up the pen d…
0
votes
1 answer

Set focus for python turtle textinput

In my python project (game) I have a function to get player (2) names: def get_names(self): self.lp_name = turtle.textinput("Left Player", "Enter your Name") self.rp_name = turtle.textinput("Right Player", "Enter your Name") enter image…
0
votes
1 answer

Score only updates once and does not update at all after

Im having trouble with keeping my score updated when my brownie, (which moves when w is pressed), is pressed. Right now it doubles the score but just stays at 2 points every time you press w after. heres the script: import turtle wn =…
0
votes
0 answers

Handling turtle graphics in memory

Is there a way to handle all of the things that are happening on my turtle window in the memory not displaying them on the screen?
Stamend
  • 33
  • 4
0
votes
2 answers

How can I rotate a shape from the bottom in turtle

I am trying to make a turtle analog clock, and to make the second, minute, an hour hands I am making a shape with turtle, and using .tilt() to tilt it 6 degrees every second. The thing is, when I run .tilt() it rotates the ship from the middle,…
Kovy Jacob
  • 489
  • 2
  • 16
0
votes
1 answer

Create transparent square in python turtle

Using python turtle, I have made a code that connects points based on weather (high = X, low = Y) and the line between the points shows the weather that day (yellow = sunny). I previously tried to make the tail fade as the line continued. After…
Anna
  • 1
0
votes
1 answer

Trying to identify if a point lies within a drawn polygon

I am trying to figure out a mathematical way to identify if a point lies inside a polygon that I draw with turtle. I am trying to only use turtle and math library to achieve this. I am not using classes either. However the problem I am facing with…
0
votes
2 answers

How can I fill in my Shape in Python with Turtle?

I would like to fill in my Shape that I have created with the turtle module in python. I have figured out the outlines and the Turtle itself, but I don`t know how to color in the finished shape. This is my code so far: trtl.fillcolor("green") …
Jessica
  • 3
  • 4