我在街机模块中运行塔防游戏,但按开始后,游戏冻结并返回
Traceback (most recent call last):
File "D:\lib\site-packages\arcade\text.py", line 278, in draw_text
label = draw_text_cache[key]
KeyError: "05064200240left('Calibri', 'Arial')FalseFalse"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\ThisPC\Downloads\The Great Skeleton War\lab_12.py", line 2890, in <module>
arcade.run()
File "D:\lib\site-packages\arcade\window_commands.py", line 236, in run
pyglet.app.run()
File "D:\lib\site-packages\pyglet\app\__init__.py", line 107, in run
event_loop.run()
File "D:\lib\site-packages\pyglet\app\base.py", line 167, in run
timeout = self.idle()
File "D:\lib\site-packages\pyglet\app\base.py", line 243, in idle
window.dispatch_event('on_draw')
File "D:\lib\site-packages\pyglet\window\__init__.py", line 1333, in dispatch_event
if EventDispatcher.dispatch_event(self, *args) != False:
File "D:\lib\site-packages\pyglet\event.py", line 422, in dispatch_event
self._raise_dispatch_exception(event_type, args, getattr(self, event_type), exception)
File "D:\lib\site-packages\pyglet\event.py", line 476, in _raise_dispatch_exception
raise exception
File "D:\lib\site-packages\pyglet\event.py", line 415, in dispatch_event
if getattr(self, event_type)(*args):
File "C:\Users\ThisPC\Downloads\The Great Skeleton War\lab_12.py", line 1136, in on_draw
arcade.render_text(globalvars.level_text, SCREEN_WIDTH - 104, SCREEN_HEIGHT - 50)
File "D:\lib\site-packages\arcade\text.py", line 88, in render_text
draw_text(text.text,
File "D:\lib\site-packages\arcade\text.py", line 281, in draw_text
image = get_text_image(text=text,
File "D:\lib\site-packages\arcade\text.py", line 218, in get_text_image
draw.multiline_text((image_start_x, image_start_y), text, text_color, align=align, font=font)
File "D:\lib\site-packages\PIL\ImageDraw.py", line 446, in multiline_text
self.text(
File "D:\lib\site-packages\PIL\ImageDraw.py", line 365, in text
ink = getink(fill)
File "D:\lib\site-packages\PIL\ImageDraw.py", line 313, in getink
ink, fill = self._getink(fill)
File "D:\lib\site-packages\PIL\ImageDraw.py", line 112, in _getink
ink = self.draw.draw_ink(ink)
TypeError: color must be int or tuple
我不确定为什么。它说我的 python 包是错误的,所以我也多次卸载并重新安装了 python。谁能帮我?提前谢谢。