turtle-graphics

Python Turtle Opacity?

穿精又带淫゛_ 提交于 2021-02-10 13:15:13
问题 Just wondering, is it possible to make a turtle draw/fill with semi-transparent ink? Something like: turtle.setfillopacity(50) # Would set it to 50% transparency Running python 2.7 回答1: It's not possible to do that, but you could define your colors, and then a light equivalent, and use those. Red = (255,0,0,0) LRed = (100,0,0) I think that would achieve similar effects. You could then just use a lighter color when you want it semi-transparent. 回答2: This python turtle example fades out the

Python Turtle window crashes every 2nd time running

两盒软妹~` 提交于 2021-02-08 07:51:46
问题 The code below is a basic square drawing using Turtle in python. Running the code the first time works. But running the code again activates a Turtle window that is non-responsive and subsequently crashes every time. The error message includes raise Terminator and Terminator Restarting kernel in Spyder (Python 3.6 on a Dell Desktop) fixes the problem in that I can then run the code again successfully, but the root cause is a mystery? Link to another question that is similar but as yet

How to show two different photos as turtles?

谁说胖子不能爱 提交于 2021-02-07 10:10:21
问题 I'm trying to import two different pictures and show them in a line using Turtle (when I'll manage to do so they are supposed to move) but I can't find a way to show them together, the last picture I assigned to the turtle and the screen is taking over. This is my code: from turtle import Turtle, Screen from PIL import Image screen = Screen() height = 200 def create_players(height): player = Turtle() pic_name = input('write exact photo name: ') image = Image.open(pic_name) new_image = image

How to show two different photos as turtles?

瘦欲@ 提交于 2021-02-07 10:10:12
问题 I'm trying to import two different pictures and show them in a line using Turtle (when I'll manage to do so they are supposed to move) but I can't find a way to show them together, the last picture I assigned to the turtle and the screen is taking over. This is my code: from turtle import Turtle, Screen from PIL import Image screen = Screen() height = 200 def create_players(height): player = Turtle() pic_name = input('write exact photo name: ') image = Image.open(pic_name) new_image = image

How to show two different photos as turtles?

故事扮演 提交于 2021-02-07 10:10:01
问题 I'm trying to import two different pictures and show them in a line using Turtle (when I'll manage to do so they are supposed to move) but I can't find a way to show them together, the last picture I assigned to the turtle and the screen is taking over. This is my code: from turtle import Turtle, Screen from PIL import Image screen = Screen() height = 200 def create_players(height): player = Turtle() pic_name = input('write exact photo name: ') image = Image.open(pic_name) new_image = image

How to show two different photos as turtles?

你。 提交于 2021-02-07 10:08:54
问题 I'm trying to import two different pictures and show them in a line using Turtle (when I'll manage to do so they are supposed to move) but I can't find a way to show them together, the last picture I assigned to the turtle and the screen is taking over. This is my code: from turtle import Turtle, Screen from PIL import Image screen = Screen() height = 200 def create_players(height): player = Turtle() pic_name = input('write exact photo name: ') image = Image.open(pic_name) new_image = image

How to show two different photos as turtles?

谁说我不能喝 提交于 2021-02-07 10:08:41
问题 I'm trying to import two different pictures and show them in a line using Turtle (when I'll manage to do so they are supposed to move) but I can't find a way to show them together, the last picture I assigned to the turtle and the screen is taking over. This is my code: from turtle import Turtle, Screen from PIL import Image screen = Screen() height = 200 def create_players(height): player = Turtle() pic_name = input('write exact photo name: ') image = Image.open(pic_name) new_image = image

Speed function doesn't change the turtles position regardless of any parameters I put in

喜夏-厌秋 提交于 2021-02-05 08:10:37
问题 The program I made has two turtles one being the user(player) and the other being player 2 which are run through a function called checkcollision which determines if the turtles intersect thus moving the second turtle to a random position of -250,250 for its x and y coordinates. The problem however is I want the second turtle(non user) to move in a straight line across the screen and I set it to 2 and I also tried setting it to normal and such all not making the turtle move. import turtle

Speed function doesn't change the turtles position regardless of any parameters I put in

流过昼夜 提交于 2021-02-05 08:08:34
问题 The program I made has two turtles one being the user(player) and the other being player 2 which are run through a function called checkcollision which determines if the turtles intersect thus moving the second turtle to a random position of -250,250 for its x and y coordinates. The problem however is I want the second turtle(non user) to move in a straight line across the screen and I set it to 2 and I also tried setting it to normal and such all not making the turtle move. import turtle

How to keep run a game in window while we are inputting in terminal python [duplicate]

早过忘川 提交于 2021-02-05 06:45:34
问题 This question already has answers here : Is there a way that while running pygame, I can also run the console too? (2 answers) Closed last year . I am new to python programming i was writing a code of snake game in which snake moves randomly on x axis. And user have to put input in terminal for the location of food and poison on x axis. And snake must be inside the food and poison. "The main thing i want to that is while the user input any location of food and Poison the snake must move whole