I am making a game using the turtle module, and want to detect colision betwen the original and the clone.I have tried saving the position of the clone, and then checking if the original has the same position, but the turtle only detects the clone if it has the exacly same position. Is there another… Read More Turtle Colision
I want to make a controller for the turtle module using the tkinter module. I wrote a code myself but it didn’t work. It also contains four forward, backward, left and right. Can someone answer me and explain with a solution? from tkinter import * import turtle def turtle(): if Button1==1: turtle.forward(100) done() if Button2==1:… Read More How can I use the tkinter module to make a controller for turtle?
I am trying to create a brick wall using turtle for my python coding class and I cannot figure out why I am receiving the error "DrawRectangleBrick() missing 1 required positional argument: ‘y’" here is where the issue is: def DrawRectangleBrick(x,y): global SQUARE_SIZE for i in range(4): if i% 2 == 0: tr.forward(SQUARE_SIZE * 2)… Read More DrawRectangleBrick() missing 1 required positional argument: 'y'
I’ve been using python for around 2 months, I’ve been mostly working with tkinter but today I’ve decided to try out turtle. I’m currently working on a clicker game where when you click a mouse(an image), you receive 1 click, what I’m having problem is that when for example, when you get 10 clicks, something… Read More What am I doing wrong? Why do the actions not work while they're supposed to?
I have a list of points given by (x, y) coordinates, and I want to connect them in a polygon shape. For example: import turtle tina = turtle.Turtle() tina.shape(‘turtle’) points = [ (40, -80), (30, -80), (30, -70), (40, -70) ] Is there a function for drawing polygons like turtle.circle()? >Solution : Try the following:… Read More How to draw a polygon given a number of points with Turtle()?
So i made a python turtle thing a while ago and it worked just fine. However, when i try to run it now it doesnt work. Here is the code: import turtle turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.exitonclick() It gives a error saying: Exception has occurred: AttributeError module ‘turtle’ has no… Read More Python Turtle Error In Visual Studio Code
I’m trying to figure out why my painting is not having the desired final outcome. As you can see, the first row is printing 10 circles but then the following rows are only printing 9. Have a look at my code, and the attached image. from turtle import Turtle, Screen import turtle import random colours… Read More How can i get the output to print 10 circles instead of 9 in python turtle module
So I found this code online because I wanted to make my own so I like tried to understand what this person was doing by looking what all the different lines do, but i came across this line and I don’t know what it does. I can’t find anything about this online and if i… Read More What does the line turtle.circle(r,360,150) do? I can't figure it out
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 input!" Everytime i do something; the program works fine but that… Read More Cannot seem to make my else statement work properly in Python-turtle
from turtle import Turtle my_turtle = Turtle() my_turtle.color(40.0, 80.0, 120.0) my_turtle.forward(50) The code works well when I try to work with str such as .color("green") or .color("#285078"), but while I work with the 3 int I get this error: Traceback (most recent call last): File "E:\Python Projects\Practice\Day 18\main.py", line 4, in <module> my_turtle.color(40.0, 80.0, 120.0)… Read More Getting error while try to color my turtle