Professional Documents
Culture Documents
LAB 8 4МСО МартиновІван
LAB 8 4МСО МартиновІван
LAB 8 4МСО МартиновІван
class Ball:
self.canvas = canvas
self.dy = 2
def ruh(self):
pos = canvas.coords(self.id)
self.dy = -1 * self.dy
canvas.move(self.id, 0, self.dy)
tk = Tk()
canvas.pack()
list_ball = []
for i in range(10):
x = randint(10, 400)
y = randint(10, 350)
def play():
for i in range(len(list_ball)):
list_ball[i].ruh()
play()
tk.mainloop()