我有两个文件,一个用于生成世界,另一个用于运行主代码。但是,主屏幕无缘无故地崩溃。我认为world gen也可能被破坏,但它至少将有效数据传递给主代码。
# Main loop.
while RUNNING:
# Fill the screen.
screen.fill((0,0,0))
# Event handling.
for eventa in event.get():
if eventa.type == QUIT:
RUNNING = f
screen.fill(SCREENCOLOR)
# Draw the world.
for tile in WORLD:
if tile.surface == None:
pass
else:
screen.blit(tile.surface,tile.location)
# Draw the character
screen.blit(PLAYER["image"],PLAYER["loc"])
# Pygame commands clear up.
clock.tick(FPS)
screen.flip()
这段代码甚至没有用白色填充屏幕。这可能只是太多的数据无法处理,如果是的话,抱歉。