New Text Document
New Text Document
# window setup
pygame.init()
clock = pygame.time.Clock()
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
WIN = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('PING_PONG')
if ball.colliderect(playerx) or ball.colliderect(playery):
ball_vel_x *= -1
while True:
#closing the window
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
ball_animation()
player_animation()
#limiting framerate
pygame.display.flip()
clock.tick(60)