def splash(w, h): for n in range(0, w, 20): yield from rectangle(x=n, y=0, w=10, h=h, fill=True) yield from rectangle(x=0, y=17, w=w, h=30, fill=False) yield from text(x=0, y=20, string='PONG!', size=3) yield from text(x=80, y=20, string='Click to') yield from text(x=80, y=30, string='START!')
def ball(data): yield from rectangle(x=data['x'], y=data['y'], w=BALL_W, h=BALL_H, fill=True)
def paddle(data): yield from rectangle(x=data['x'], y=data['y'], w=PADDLE_W, h=PADDLE_H, fill=True)
def brick(data): yield from rectangle(x=data['x'] + BRICK_BORDER, y=data['y'] + BRICK_BORDER, w=BRICK_W - BRICK_BORDER, h=BRICK_H - BRICK_BORDER, fill=True)
def splash(w, h): for n in range(0, w, 20): yield from rectangle(x=n, y=0, w=10, h=h, fill=True) yield from rectangle(x=0, y=17, w=w, h=30, fill=False) yield from text(x=0, y=20, string='BREAKOUT', size=3)
def ball(x, y): yield from rectangle(x=x, y=y, w=BALL_W, h=BALL_H, fill=True)
def paddle(user): yield from rectangle(x=user['x'], y=user['y'], w=PADDLE_W, h=PADDLE_H, fill=True)