Professional Documents
Culture Documents
New Text Document
New Text Document
# Colors
WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
GREEN = (0, 255, 0)
GRAY = (128, 128, 128)
YELLOW = (255, 255, 0)
# Game settings
BLOCK_SIZE = 50
GRID_SIZE = 10
# Player position
player_x = 0
player_y = 0
# Respawn position
respawn_x = 0
respawn_y = 0
# Player speed
player_speed = 1 # Normal speed
sprinting = False
# Player velocity
player_vel_x = 0
player_vel_y = 0
# Gravity
gravity = 0.5
falling = True
# Grid data
grid = [[0] * GRID_SIZE for _ in range(GRID_SIZE)]
# Player inventory
inventory = {
"diamond": 0,
"iron": 0,
"gold": 0
}
# Game loop
running = True
clock = pygame.time.Clock()
while running:
screen.fill(WHITE)