May-24-2019, 03:08 AM
hello,
couple of my observations:
Add a frame.
try the canvas.update() instead of deleting and redrawing
couple of my observations:
Add a frame.
class MySnake(Frame): def __init__(self, parent= None): self.parent= parent Frame.__init__(self, self.parent) self.pack(expand=YES, fill=BOTH)eliminate the move class and use the Canvas.move(object, x,y)
def move_snake(self, x,y): #x left or right y up or down while True: self.canvas.move(self.snake_head,x,y) .....
try the canvas.update() instead of deleting and redrawing
self.canvas.update() time.sleep(0.04)make snake food a function instead of a class