Welcome to my Website!

This is a paragraph! Here's how you make a link: Neocities.

Here's how you can make bold and italic text.

Here's how you can add an image:

Here's how to make a list:

To learn more HTML/CSS, check out these tutorials!

import pygame # Initialize Pygame pygame.init() # Define constants WINDOW_WIDTH = 640 WINDOW_HEIGHT = 480 BALL_RADIUS = 10 PADDLE_WIDTH = 15 PADDLE_HEIGHT = 60 PADDLE_SPEED = 5 BALL_SPEED = 5 FONT_SIZE = 30 # Define colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) # Create game window screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT)) pygame.display.set_caption('Pong') # Create paddles and ball player_paddle = pygame.Rect(50, WINDOW_HEIGHT / 2 - PADDLE_HEIGHT / 2, PADDLE_WIDTH, PADDLE_HEIGHT) computer_paddle = pygame.Rect(WINDOW_WIDTH - 50 - PADDLE_WIDTH, WINDOW_HEIGHT / 2 - PADDLE_HEIGHT / 2, PADDLE_WIDTH, PADDLE_HEIGHT) ball = pygame.Rect(WINDOW_WIDTH / 2 - BALL_RADIUS / 2, WINDOW_HEIGHT / 2 - BALL_RADIUS / 2, BALL_RADIUS, BALL_RADIUS) # Initialize ball velocity ball_vel = [BALL_SPEED, BALL_SPEED] # Load font for displaying score font = pygame.font.Font(None, FONT_SIZE) # Initialize scores player_score = 0 computer_score = 0 # Create game loop running = True while running: # Handle events for event in pygame.event.get(): if event.type == pygame.QUIT: running = False elif event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE: running = False # Move player paddle keys = pygame.key.get_pressed() if keys[pygame.K_UP]: player_paddle.y -= PADDLE_SPEED elif keys[pygame.K_DOWN]: player_paddle.y += PADDLE_SPEED # Keep player paddle inside screen if player_paddle.top < 0: player_paddle.top = 0 elif player_paddle.bottom > WINDOW_HEIGHT: player_paddle.bottom = WINDOW_HEIGHT # Move computer paddle if ball.top < computer_paddle.top: computer_paddle.y -= PADDLE_SPEED elif ball.bottom > computer_paddle.bottom: computer_paddle.y += PADDLE_SPEED # Keep computer paddle inside screen if computer_paddle.top < 0: computer_paddle.top = 0 elif computer_paddle.bottom > WINDOW_HEIGHT: computer_paddle.bottom = WINDOW_HEIGHT # Move ball ball.x += ball_vel[0] ball.y += ball_vel[1] # Handle ball collisions if ball.top < 0 or ball.bottom > WINDOW_HEIGHT: ball_vel[1] = -ball_vel[1] elif ball.left < player_paddle.right and ball.bottom > player_paddle.top and ball.top < player_paddle.bottom: ball_vel[0] = -ball_vel[0] elif ball.right > computer_paddle.left and ball.bottom > computer_paddle.top and ball.top < computer_paddle.bottom: ball_vel[0] = -ball_vel[0] elif ball.left < 0: computer_score += 1 ball.x, ball.y = WINDOW_WIDTH / 2 - BALL_RADIUS / 2, WINDOW_HEIGHT / 2 - BALL_RADIUS / 2 ball_vel = [BALL_SPEED, BALL_SPEED] elif ball.right > WINDOW_WIDTH: player_score += 1