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
2 answers

Python Turtle Enumerate

Is anyone able to explain this code? My friend wrote it and I don’t understand anything about the line defining “diff” import math import turtle import random t = turtle.Turtle() screen =…
0
votes
1 answer

Turtle goto method

from turtle import Turtle, Screen import time screen = Screen() screen.setup(width=600, height=600) screen.bgcolor('black') screen.title('Snake') screen.tracer(0) starting_positions = [(0, 0), (-20, 0), (-40, 0)] segments = [] for position in…
abcdefg
  • 1
  • 3
0
votes
0 answers

Is shows No Such directory what shall i do i'm new to programming please hlep

This is IITB simplecpp i am trying to run the program but it shows the following issue..if anyone an help with it i'm new to this.
0
votes
1 answer

random lines between rendered objects python

I am making a very basic 3d engine. When I render 2 or more objects, it draws lines between them. I do not know why this happens, as I coded the pen to go up after drawing every triangle. A strange thing is that when I draw a background line, each…
0
votes
1 answer

finding if you can get from one point to another by lines

I wrote this class about a graph in which it takes a list v for the name of dots and a tuple e for which dots are connected through a line. now I want to know which dots I can get from one to another through these lines. for example in : G =…
Polat
  • 57
  • 4
0
votes
2 answers

Is there a function in the keyboard module that returns ANY letter that is pressed?

I'm having trouble using the keyboard module. I'm working on a typing game in turtle graphics. The user types and a "guide" arrow above the sentence shows the user how far they've typed. The arrow is supposed to turn red when an incorrect letter is…
SWEEPC
  • 3
  • 3
0
votes
1 answer

Displaying the cosine function with specified periods (turtle)

I'm using the turtle api to finish [this assignment] (http://sites.asmsa.org/java-turtle/exer/5-function-graphing). I'm stuck on graphing the cosine function displaying a user-specified number of periods. The for loop is what I'm using to generate…
0
votes
1 answer

Turtle graphics - framerate?

Using Turtle Graphics and Python -- I have a group of 10 basic graphic elements on the screen at the same time and it runs sluggish. As soon as some of the elements "leave" the graphic window, it speeds up considerably. Is there a way to maintain…
netrate
  • 423
  • 2
  • 8
  • 14
0
votes
2 answers

How to make a 'turtle color checker' in turtle?

I'm trying to make a code that check the turle's current color in python, something like this: if turtle.color()=='gray': pass else: color = input('type some color: ') turtle.color(color) But for some reason, it's not working... Also, I…
plsHelpMe
  • 15
  • 6
0
votes
1 answer

Can't return turtle position

when trying to return the position, python says it is missing mx and my, but when I add them, it says they are not defined import turtle def get_mouse_click_coor(mx, my): print(mx,…
0
votes
1 answer

Why my python kept crashing when it tried to run the turtle.tracer() method in turtle module?

I was coding a Snake Game using turtle module but when I add this line into my code the turtle screen and python crashed: turtle.tracer(0) can somebody help me so I can complete the game? Thanks a lot my code: from turtle import Turtle, Screen,…
0
votes
1 answer

Formula for generating lines of (any) polygon with only given information being that the polygon is regular, the center is at a given point, & x sides

I am generating a 3d renderer in python, that when given a list of 3D lines, it converts them to 2D and draws them on the screen with turtle graphics. This is an example for a set of 3D lines: # import math import turtle import random import…
Anonymous
  • 13
  • 2
0
votes
1 answer

Combining python turtle and tkinter`

I need to combine python turtle and tkinter for tic tac toe game, I looked at some sites and tried, but it didn't worked as I imagine, so I need help. Code: from turtle import * from circle import Tac from cross import Tic from tkinter import…
Marko
  • 123
  • 1
  • 10
0
votes
1 answer

Python Turtle - Issue with custom shape in Snake program

I have a python program using turtle to make the game "Snake". It is fully functional. At this point I'm adding in .gif images to spruce it up. The problem arises when I'm trying to use a custom shape as the head of the snake. If I use a basic shape…
0
votes
1 answer

How to make a turtle draw above another one?

I'm making a project where I have a turtle drawing a black line, but following it is another turtle drawing a white line. I want this white line to draw over the black line to "erase" the black line, but the black line remains above the white…
1 2 3
99
100