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

How can I add multiple keys to listen in python turtle?

I want to put more keys in the python turtle but every time I do that it tells me an error. Is there any way I can do it with multiple keys? Code: screen.listen() screen.onkey(tic.one, "1") screen.onkey(tic.two, "2") screen.onkey(tic.three,…
Marko
  • 123
  • 1
  • 10
0
votes
1 answer

Python3-Turtle: Pen color not changing

I have a function that draws a brick wall, with the option to set a certain pen color before the wall is drawn, however it seems that the brick is drawn as green no matter what I do: def draw_brick(length, width): t.color("green") …
0
votes
0 answers

Why isn't the turtle moving?

I was coding a turtle game where when the snake goes near the "apple", it goes to a random cord and we repeat. I tried to add a go to function in python but it is not moving for some reason. I added a check to see if the if statement is happening…
0
votes
1 answer

Turtle graphics setpos() does nothing

For some reason my code works until it gets to line 67 (bold text). The cursor should move down 100px on the y axis but it stays there and draws the boxes over the second darkblue one. Does anybody know why that is. Help would be gladly appreciated.…
orellana
  • 1
  • 1
0
votes
0 answers

Trying to draw circle when I click screen but draws before I click because coordinates defined as variables

In Python turtle, I'm trying to print a circle when I click the screen, but it prints before I even click because the x,y coordinates are defined as variables. I was trying to make tic tac toe and so far it makes the lines and when I click in a…
0
votes
2 answers

getting error message while runing code in pycharm

I'm trying to run a code that will draw a LOVE image using pycharm but i get an error that i seem unable to fix. Please, i need help with this. what am i doing wrong? ''' Traceback (most recent call last): File…
NPeter
  • 1
  • 1
0
votes
1 answer

Up arrow key not working for python turtle

I have used the onkey function for the right and left: sc.onkey(user_left,"left") sc.onkey(user_right,"right") I have also set the screen after setting the turtle and importing turtle: sc=Screen() But when I use the same format for up and…
SuperByte
  • 7
  • 5
0
votes
1 answer

Is there a way to know the width of a character in turtle graphics?

I'm currently making a typing game in turtle graphics. As the user types, an arrow above the sentence they are typing moves. This is used to show the user where they are in the sentence. However, I'm having trouble making the arrow stay above the…
SWEEPC
  • 3
  • 3
0
votes
1 answer

Python: How to refresh the turtle window

is there some kind of method to refresh the turtle screen while keeping the turtle drawings and the pen having the same attributes, it's kind of like reloading a page but it still has the same content
Curry boy
  • 1
  • 1
0
votes
3 answers

Turtle drawing backwards

This is easily the dumbest question I have ever had to ask, but I'm trying to use Turtle to code something that will take English inputs and draw letters in an alphabet I created for a D&D campaign. I'm trying to draw a letter like this: Letter I'm…
0
votes
1 answer

How do you make a conditional loop with onkeypress()?

I'm working on a python project for my intro class where I want to make a blizzard with the turtle module. So far, I've been able to make a "snowflake" appear on each keypress but I'm not sure how to make it into a conditional loop where when I…
say
  • 51
  • 7
0
votes
2 answers

Python (Turtle) Remove turtle / arrow

I am trying to make a basic Pong and I don't understand why the arrow/turtle in the middle of the screen displays. The paddle on the screen consists of 6x turtle objects stored in self.paddle. I know the problem has something to do with the p =…
Karim Loberg
  • 95
  • 1
  • 7
0
votes
1 answer

How to combine Turtle with tkinter

So I've got tkinter code that when ran, opens up a new window with a square root calculator, when I try to get turtle in the same window as the square root calculator, 2 windows pop up import tkinter as tk from turtle import Turtle, Screen root =…
0
votes
1 answer

How do I fix the TypeError 'builtin_function_or_method' object is not subscriptable

I'm trying to split a string into two separate coordinates using split(). The TypeError in the headline calls back to these lines: #Coordinate input coords = input("Please enter the coordinates of the starting point separated by a space:") #Turtle…
Asgard
  • 81
  • 2
  • 10
0
votes
1 answer

Is there a way to prevent ParseError from coming up every time I execute this code?

Here is the code: import turtle import random import time colors = ["red", "firebrick", "darksalmon", "sandybrown", "gold", "olivedrab", "chartreuse", "palegreen", "darkgreen", "seagreen", "mediumspringgreen", "lightseagreen", "darkcyan",…
1 2 3
99
100