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 do you make a diamond shape in turtle python?

I am struggling to make a diamond in python turtle, I have tried to find tutorials but it is not the shape I want. this is the shape I want. Diamond shape I want: Can you please help me? code: for _ in range(1): turtle.left(60) …
RetroMerc
  • 11
  • 1
0
votes
1 answer

Python turtle passing a tuple to turtle.shapesize() method gives error 'TypeError: can't multiply sequence by non-int of type 'float''

from turtle import Turtle, Screen pos = (100,100) size = (30, 30) # This is the tuple screen = Screen() turtle = Turtle() turtle.goto(pos) # This statement works fine turtle.shapesize(size) # This line gives…
Anmol Virk
  • 3
  • 1
  • 3
0
votes
0 answers

How can I determine accurate, real-world measurements on lines drawn with the Turtle module in Python?

I've written a program which draws a box template which can be printed, cut, scored and folded into a small box. The program askes the user for the length and width of the box in mm. The tabs of the box are all 15mm. After a bit of Googling, I found…
0
votes
2 answers

What is wrong with this code to change colors with turtle graphics?

I have this code, using turtle graphics in Python: import turtle import time as wait turtle.setup(500,500) ws = turtle.Screen() ws.title('epic…
cycooYT
  • 11
  • 3
0
votes
1 answer

Can i tell my turtle to NOT do anything when the user input is higher than 7?

I made a code of connect 4 in python turtle, and i made a list of all the columns. There are 7 columns, but if you type in '8' it will end the game with an error. Can i change it somehow that it doesn't give you an error but instead just does…
0
votes
1 answer

How can I increase the speed of my object like with levels in a game?

in my code, which is for a game, I want to increase the speed of my randomly moving object ( here I call it squidward ) every time a certain amount of clicks and level is reached. However, my function is not working. I think the function itself…
Sahar
  • 1
  • 1
0
votes
1 answer

failing to have multiple turtle go off in different directions due to unknown error

in python3.8 i am trying to have multiple turtle go off in different directions but whenever i execute the bellow code import turtle ivan = turtle.Turtle() amy =…
0
votes
1 answer

OOP classes and variables python turtle graphics?

We're trying to make the turtle color be coral and came across this. from turtle import Turtle, Screen # case 1: assign variable foo = Turtle() foo.shape("turtle") foo.color("coral") Screen().exitonclick() # case 2: use it w/o…
0
votes
2 answers

How to test specific RGB values generated from random.randint in Python turtle?

I want to write a prompt message at turtle.Screen() every time the turtle, that generates random color when hitting the border, generates a lime green color (50, 205, 50). import random import turtle import math turtle.colormode(255) # random…
0
votes
1 answer

Cannot seem to make my else statement work properly in Python-turtle

sorry I am a bit of a beginner and I am having trouble gettin the else statement working properly in this program i made to draw stuff in turtle with python. I tried indenting the else statementelse: print("Wrong input!")but then it just says "Wrong…
0
votes
1 answer

how to detect if a turtle is near a different turtle

im trying to create a game in python where you need to shoot moving turtles above you, but i dont know how to make the attack detect the turtle and remember it. it also has a problem of when that i shoot the turtles that need to be hit stop…
0
votes
3 answers

Simple game is very laggy

I've just started coding a little game using turtle, but my very first prototype is already very laggy. import turtle import keyboard # Player 1 x and y cords p1x = -350 p1y = 250 wn =…
Rektic
  • 13
  • 2
0
votes
1 answer

Python Turtle Pixels Position output refers to what part?

Hey all here is the code if you want to reproduce the game note it's not complete. I have a brief question regarding the command in python turtle "yourtext.ycor() or yourtext.xcor()". So, I know that this command will return a coordinate position…
Rudy F.
  • 9
  • 1
0
votes
1 answer

python turtle program gives "Exception in Tkinter callback" error

I am trying to write a python program of two turtles chasing another turtle. yet the code crashes a few seconds into the game giving me an "Exception in Tkinter callback" Exception in Tkinter callback Traceback (most recent call last): File…
nada
  • 1
0
votes
1 answer

Why does a while True loop not work in my rock paper scissors game?

I'm trying to make a rock paper scissors game with 3 buttons to click on on-screen with import turtle. That went well and it worked, the buttons worked and the right text showed up on screen when clicking a certain button. (I haven't added the…