def __init__(self, arena: Arena, x: int, y: int): self._x = x self._y = y self._dx = 5 self._dy = 0 self._g = 0.3 self._arena = arena arena.add(self)
Returns: (int, int) -- the position of current sprite ''' return def update(): canvas_fill(canvas, (0, 0, 0)) arena.move_all() for a in arena.actors(): x1, y1, aw, ah = a.rect() draw_rect(canvas, (0, 255, 255), (x1, y1, 50, 50)) arena = Arena(1000, 1000) f1 = FallingBall(10, 10) f2 = FallingBall(70, 70) p1 = Plane(1, 350) p2 = Plane(1, 250) p3 = Plane(1, 150) arena.add(f1) arena.add(f2) arena.add(p1) arena.add(p2) arena.add(p3) canvas = canvas_init((1000, 1000)) set_interval(update, 1000 // 30)