КВАДРАТИК ДОЛЖНГ ПОДПРЫГНУТЬ
from tkinter import*
root = Tk()
c = Canvas(root, width = 500, height = 500, bg = "white")
c.pack()
x1 = 50
y1 = 400
x2 = 100
y2 = 500
make_jump = False
jump = 30
def kadr(event):
global make_jump
if event.keysym == "Up":
make_jump = True
if make_jump:
jump2()
c.create_rectangle(x1, y1, x2, y2, fill = "blue")
def jump2():
global y1, y2, jump, make_jump
if jump >= -30:
y1 -= jump
jump -= 1
else:
jump = 30
make_jump = False
root.bind("<Key>", kadr)
root.mainloop()
from tkinter import*
root = Tk()
c = Canvas(root, width = 500, height = 500, bg = "white")
c.pack()
x1 = 50
y1 = 400
x2 = 100
y2 = 500
make_jump = False
jump = 30
def kadr(event):
global make_jump
if event.keysym == "Up":
make_jump = True
if make_jump:
jump2()
c.create_rectangle(x1, y1, x2, y2, fill = "blue")
def jump2():
global y1, y2, jump, make_jump
if jump >= -30:
y1 -= jump
jump -= 1
else:
jump = 30
make_jump = False
root.bind("<Key>", kadr)
root.mainloop()