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

Is there a more efficient way to do this?[python]

I'm creating genius square in python(genius square is a board game where you fit tetris-like pieces into a square with circles in certain positions). I'm trying to find a way to convert the input to placing the circles on the grid. This is my…
Dylan Ayre
  • 11
  • 1
0
votes
0 answers

How to move object around with arrow keys in python turtle

I am trying to move the object around the screen with the arrow keys. I have left and right how I want them, but when I am trying to go up it doesn't work how I want. I tried to use player.left(90) then move forward but then I have to use the right…
0
votes
1 answer

using the turtle module without opening the canvas (to obtain coordinates)

Is it possible to use the turtle module to obtain coordinates (turtle.pos() once at the desired locations) without it opening a canvas? I know this probably seems silly and defeats the point of the turtle module, but it's actually a very useful way…
0
votes
2 answers

Metadata-generation-failed error when installing Turtle on VSCode

I tried to install turtle on my VS Code and got this error message, could you guys tell me what's going on with this module, please?
0
votes
0 answers

Python - easily converting float to rounded number for set checking (turtle graphics)

I'm having an issue with my snakegame on the collision detection side. What I wrote originally to do so was this: snakecollisionchecklist = len(snake.snake_coord_list) snakecollisionchecklistset = len(set(snake.snake_coord_list)) if…
Dragnipur
  • 125
  • 8
0
votes
0 answers

what is a terminator error and how to fix it?

from random import choice from turtle import * from base import floor,vector from tkinter import * root=Tk() state={'score':0} path=Turtle(visible=False) writer=Turtle(visible=False) aim=vector(5,0) pacman=vector(-40,-80) ghosts=[ …
nev nev
  • 5
  • 6
0
votes
1 answer

Is there any way to change the outline size of a turtle compound shape?

I am trying to create a compound shape. What I want now is to change the outline size of this new compound shape. I have made the shape like this: import turtle points_1 = [...] # list of points points_2 = [...] # list of points shape =…
M.Sarabi
  • 51
  • 1
  • 9
0
votes
0 answers

Python Turtle Window freezes when I execute the code

I made a simple text-based tic-tac-toe game and now I am trying to step it up creating a GUI using the Turtle module. The problem is that when I run my program, the Turtle window draws the board correctly, but then freezes and stops responding. I…
0
votes
2 answers

Is there a way to assign a color to a range of numbers in a list?

I am using python under the turtle module. In this code I am drawing multiple squares at a certain point of the window. However, I would like to change the colors of the lines that is dependent on the value I want to give. For example, from value…
Zacker Yeo
  • 11
  • 2
0
votes
0 answers

How can I close my Turtle display properly

I am currently learning about the turtle module in Python. However, I stumbled upon an issue. I want to note that I ran everything on Jupyter Notebook in Anaconda, on my Macbook air (M1 chip). The issue is when I ran this code below, everything went…
0
votes
1 answer

How can I make the semicircle slanted and curved at the side and the bottom using turtle?

t = turtle.Pen() t.left(90) for x in range(180): t.forward(1) t.right(1) t.right(90) t.forward(115) The pink eye that is slanted and curved at the sides and the bottom:
Anusya
  • 1
  • 1
0
votes
1 answer

Another AttributeError in OOP Python

So I'm currently creating a sort of snake game, which uses OOP, and now I've created a Snake Class, which you can see here below. from turtle import Turtle #Create the Snake Body and Class, starting with 3 white squares. STARTING_POSITIONS =…
0
votes
2 answers

How to choose a random color for each ball that will show up every time?

This is a simple python "flappy bird" game. I am struggling with choosing a random color for each ball that will show up every time — how can I do it? from random import * from turtle import * from freegames import vector bird =…
StarXfire
  • 3
  • 2
0
votes
1 answer

How to compensate for shepard tabletop illusion in 3D engine

I am creating a 3d engine in python using turtle. When you rotate the cube it looks like it is stretching even though i am pretty sure my code is correct. import turtle import time import keyboard import math # Movement horizontalRotation =…
0
votes
0 answers

Snake game wall collision not working correctly

currently I am trying to code a snake game in Python using the turtle module. Right now I am having issues with detecting collision with the wall and the snake head. from turtle import Screen from snake import Snake from food import Food from…