为什么即使设置了我的窗口也无法加载

随机词:提醒 碟 传 哭 极 套房 远 马蹄铁 沥青 体育场 自由派 有效 运动员 耳 尼姑 白色 方程 内 恶化 勉强 书 流产 倾倒 流血的 北 违反 寄存器 作曲家 相反 国王 欲望 变体 车皮 分析员 澄清 带 着迷 很多 脚本 学生 挂 芯片 切割 评估 舔 橄榄球 抢劫 定义 功率 年 一个不完整的街机游戏,现在它应该会在弹出窗口上生成气泡,但是由于某种原因,每当我运行该程序时,它都无法加载弹出窗口。您能告诉我为什么会这样,然后我才能恢复工作。 这是我的代码:

#An actual Game :)
from tkinter import *
HEIGHT = 500
WIDTH = 800
window = Tk()
window.title('Bubble Blaster')
c = Canvas(window, height=HEIGHT, width=WIDTH)
c.pack()
#LOG:Ii have just vreated the screen for the game
ship_id = c.create_polygon(5, 5, 5, 25, 30, 15, fill='red')
ship_id2 = c.create_oval(0, 0, 30, 30, outline='red')
SHIP_R = 15
MID_X = WIDTH / 2
MID_Y = HEIGHT / 2
c.move(ship_id, MID_X, MID_Y)
c.move(ship_id2, MID_X, MID_Y)
#LOG: I have just created the plyer avatar
SHIP_SPD = 10
def move_ship(event):
    if event.keysym == 'Up':
        c.move(ship_id, 0, -SHIP_SPD)
        c.move(ship_id2, 0, -SHIP_SPD)
    elif event.keysym == 'Down':
        c.move(ship_id, 0, SHIP_SPD)
        c.move(ship_id2, 0, SHIP_SPD)
    elif event.keysym == 'Left':
        c.move(ship_id, -SHIP_SPD, 0)
        c.move(ship_id2, -SHIP_SPD, 0)
    elif event.keysym == 'Right':
        c.move(ship_id, SHIP_SPD, 0)
        c.move(ship_id2, SHIP_SPD, 0)
c.bind_all('<Key>', move_ship)
#LOG: I have just made the ship move
from random import randint
bub_id = list()
bub_r = list()
bub_speed = list()
MIN_BUB_R = 10
MAX_BUB_R = 30
MAX_BUB_SPD = 10
GAP =  100
def create_bubble():
    x = WIDTH + GAP
    y = randint(0, HEIGHT)
    r = randint(MIN_BUB_R, MAX_BUB_R)
    id1 = c.create_oval(x - r, y - r, x + r, y + r, outline='white')
    bub_id.append(id1)
    bub_r.append(r)
    bub_speed.append(randint(1, MAX_BUB_SPD))
def move_bubbles():
    for i in range(len(bub_id)):
        c.move(bub_id[i], -bub_speed[i], 0)
from time import sleep, time
BUB_CHANCE = 10
#LOG: starting main game development
while True:
    if randint(1, BUB_CHANCE) == 1:
        create_bubble()
    move_bubbles()
    window.update
    sleep(0.01)