for food in self.foods: canvas.delete(canvas.drawnfood[z]) del canvas.drawnfood[z] self.foods = [] canvas.delete(canvas.drawnplayer) self.init_objects() self.startgame() widthPixel = 720 heightPixel = 720 root = Tk() root.configure(bg='white') root.title("1337 H4X0R5") root.resizable(width=0, height=0) slider = Scale(root, from_=0, to=2, orient=HORIZONTAL, resolution=0.01) slider.configure(bg='white', highlightthickness=0) slider.pack() label = StringVar() Label(root, textvariable=label, bg='white').pack() canvas = Field(root, widthPixel, heightPixel) canvas.configure(bg='grey') canvas.pack() game = game(root, slider, canvas, label) game.init_objects() game.startgame()