

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Modules
incomplete
2: Logging Game State
incomplete
3: Game Loop
incomplete
4: FPS
incomplete
This lesson's interactive features are locked, please to keep using them
Video games are generally built using a game loop. The simplest game loop has 3 steps:
To create a good user experience, these 3 steps need to happen many times per second.
from logger import log_state
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
for event in pygame.event.get():
pass
uv run main.py
for event in pygame.event.get():
if event.type == pygame.QUIT:
return
Run and submit the CLI tests.