Questions tagged [python-turtle]

The python turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways.

507 questions
3
votes
6 answers

Turtle direction in turtle graphics?

How can I tell a turtle to face a direction in turtle graphics? I would like the turtle to turn and face a direction no matter its original position, how can I achieve this?
Gabe Sweet
  • 57
  • 1
  • 2
3
votes
6 answers

Difference between turtle and Turtle?

How are turtle and Turtle different from each other in python version 2.7? import turtle star = turtle.Turtle() for i in range(50): star.forward(50) star.right(144) turtle.done()
Jdpurohit
  • 61
  • 5
2
votes
1 answer

In the Hilbert Curve, How can I change the library turtle from to matplotlib?

I dont really know how can be solved keeping the recursion, I was studying the turtle library but in the asignature they ask for use matplotlib so I am not really sure about how take it from turtle import Turtle def hilbert_curve(turtle, A,…
2
votes
2 answers

How to return an image using turtle.bgpic()

I'm trying to write a bit of code that will show me a picture of a map but when I run the code it's not returning the image or any sort of error. After doing a bit of research I don't think I need any other code but any help would be greatly…
LEJ2474
  • 37
  • 4
2
votes
0 answers

3D objects glitching when getting to close to camera

The Problem I am making a 3D engine with the Python module Turtle. It works 'ok' right now with some bugs (no camera rotation, faces not rendering in the correct order, and projection not looking right). The main bug is that when I go past a certain…
drakeerv
  • 191
  • 1
  • 1
  • 12
2
votes
2 answers

Python turtle: trigger function on any key pressed

How can I add random key pressed with turtle (that means that I don't want this:scr.onkey(fun,'r')? I tried this... import turtle as system scr=system.Screen() def p(): print('button pressed') scr.onkey(p,any) ...but this does not work. How…
George
  • 21
  • 3
2
votes
1 answer

Python turtle module collision doesn't work at final level

I have some problem with my project. I want a game where from right side comes 5 TIE fighters(enemies) and you have to shot them in order to get points. After you reach 100 point (in code 5 for testing reasons) a boss comes and you need to kill…
nooel
  • 23
  • 4
2
votes
1 answer

Making an aspect disappear

I am making a pong game in python, and Im trying to make text appear for a few seconds and then disapear, can someone help me with…
2
votes
2 answers

AttributeError: 'Player' object has no attribute 'go_up'

I keep on getting an error saying Player object has no attribute go_up when i have clearly defined it in the player class. Error message: File "C:\Users\mctri\OneDrive\Desktop\Maze game\src\main.py", line 134, in
2
votes
0 answers

Is it possible to make a shake effect in python turtle?

I'm learning python turtle and I was wondering if there is a way to make a shake effect? For example if I want my figures arm to be scratching his head or just waveing? How can this be done? Like I said i'm new to this so this might be stupid…
Vincentino
  • 273
  • 1
  • 3
  • 15
2
votes
2 answers

Draw Co-ordinates using Turtle

I'm trying to draw a set of co-ordinates using Python Turtle, however ,I'm stuck and have no clue how to move on. def generate_map(x_range, y_range, locations): generated_map = [] for x in range(locations): …
2
votes
2 answers

Is there a way to mirror a python function?

I am a student taking my first python class and we are using Turtle to draw an image. In an effort to save time I am trying to create a mirror function that can flip one functions results over the y-axis by a given number of pixels. For the sake of…
armysBest
  • 33
  • 3
2
votes
2 answers

Python Turtle or any other library for 2D drawing

I am using python3.7 and its math and turtle module I have to draw a 2D sketch with arcs. For example Draw a main circle with radius 1.5m Draw another arc with radius of 1.7m and 2.8m from 5 degree to 75 degrees and join their end point Now draw…
Rakesh
  • 23
  • 4
2
votes
1 answer

How do you make a collision detection for turtle in python?

I'm having a problem, When I use the code: from turtle import Turtle, Screen playGround = Screen() playGround.screensize(500, 500) playGround.title("Race") x=0 run =…
user14991433
  • 25
  • 11
2
votes
2 answers

Does turtle something like a Ctrl-Z (Undo) function?

I'm trying to code an whiteboard program so I need to have something like Ctrl-Z (Undo) function in it. If someone knows the answer please tell me.
1
2
3
33 34