def create_big_plane(root, canvas, enemy_list): x = rd.randint(0, config.window_boundary_col - config.image_bigplane_width) big_plane = bigplane.BigPlane(root, canvas, tkinter.SW, x, 0, "BigPlane") tmp_canvas_img = canvas.create_image(big_plane.anchor_x, big_plane.anchor_y, anchor=big_plane.anchor, image=big_plane.bg_image, tags=big_plane.bg_image_tags) big_plane.set_canvas_image(tmp_canvas_img) enemy_list.insert(0, big_plane) config.defeat_big_nums += 1
def create_big_plane(root, canvas, enemy_list): #rd = 內建random隨機數 #(0到,室窗口寬-飛機圖的最大寬度) x = rd.randint(0, config.window_boundary_col - config.image_bigplane_width) big_plane = bigplane.BigPlane(root, canvas, tkinter.SW, x, 0, "BigPlane") #(X為隨機,Y= 0,SE西南,BigPlane) tmp_canvas_img = canvas.create_image(big_plane.anchor_x, big_plane.anchor_y, anchor=big_plane.anchor, image=big_plane.bg_image, tags=big_plane.bg_image_tags) big_plane.set_canvas_image(tmp_canvas_img) #插入列表 enemy_list.insert(0, big_plane) #增加敵機數量 config.defeat_big_nums += 1