Metin
Metin
import sys
# Initialize Pygame
pygame.init()
# Player settings
player_size = 40 # Player size in pixels
player_x, player_y = SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2 # Player start position
at the center
player_vel_x, player_vel_y = 0, 0 # Initial player velocities
walk_speed = 5 # Maximum walking speed
jump_force = 10 # Force applied for jumping
gravity = 0.5 # Gravity effect on player (pulling down)
on_ground = False # Tracks if player is on the ground
air_cntrl_pwr = 15 # Air control adjustment (to limit horizontal speed in the air)
grnd_cntrl_pwr = 10 # Ground control adjustment (for horizontal speed on the
ground)
# Game loop
running = True
while running:
# Event handling
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()