[英]I cant make a paddle in python with the turtle module
我找不到問題,我已經看了好幾遍代碼。(我是初學者)它不會做槳。
import turtle
wn = turtle.Screen()
wn.title("pong by ChunkyChungus")
wn.bgcolor("black")
wn.setup(width=800, height=600)
wn.tracer(0)
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stretch_wid=5, stretch_len=1)
paddle_a.penup()
paddle_a.goto(-350, 0,)
wn.exitonclick()
請在這件事上給予我幫助?
看起來 'wn.tracer(0)' 是阻止海龜形狀的原因。 以下代碼對我有用。 請注意,我已經注釋掉了“wn.tracer(0)”。
import turtle
wn = turtle.Screen()
wn.title("pong by ChunkyChungus")
wn.bgcolor("black")
wn.setup(width=800, height=600)
# wn.tracer(0)
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stretch_wid=1, stretch_len=5)
paddle_a.penup()
paddle_a.goto(-350, 0,)
wn.exitonclick()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.