Overview
Pygame 2.4, released on July 11, 2023, prepares Python 3.12 compatibility and improves the pygame.event module.
Main Features
Python 3.12 preparation
Deprecated CPython 3.12 C APIs have been updated. Pygame 2.4 builds and runs without warnings on Python 3.12.
python
import pygame
import sys
pygame.init()
screen = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Pygame 2.4')
print(f'Python {sys.version}')
print(f'Pygame {pygame.ver}')
pygame.quit()
Event improvements
The pygame.event module gains better queue performance and more efficient event filtering.
python
import pygame
pygame.init()
screen = pygame.display.set_mode((400, 300))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()
