使用Turtle模块的Python蛇游戏

2024-05-18 21:23:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我收到错误信息: 我尝试更新python,但没有更新,所以只是修复,没有帮助

我不知道你要补充什么,我乞求

File "C, line 11, in <module>
    head = turtle.Turtle()
  File "C, line 3814, in __init__
    RawTurtle.__init__(self, Turtle._screen,
  File "C, line 2558, in __init__
    self._update()
  File "C, line 2661, in _update
    self._update_data()
  File "C, line 2647, in _update_data
    self.screen._incrementudc()
  File "C, line 1293, in _incrementudc
    raise Terminator
turtle.Terminator

Process finished with exit code 1

删除的路径

import turtle

window = turtle.Screen()
window.title("Snake")
window.bgcolor("green")
window.setup(width=600, height=600)
window.tracer(0)

window.mainloop()

head = turtle.Turtle()
head.speed(0)
head.shape("square")
head.color("orange")
head.penup()
head.goto(0,0)
head.direction = "stop"


while True:
    window.update()

Tags: inselfdatainitlineupdatewindowscreen

热门问题