

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: Sprites
incomplete
2: Draw Player
incomplete
3: Moving Around
incomplete
4: Moving
incomplete
5: Groups
incomplete
This lesson's interactive features are locked, please to keep using them
We want the spaceship to be able to move; but what does that mean specifically? Let's break it down:
Left and right seem pretty similar. Let's try to write a small function to tackle those first!
def update(self, dt: float) -> None:
keys = pygame.key.get_pressed()
if keys[pygame.K_a]:
# ?
if keys[pygame.K_d]:
# ?
If you're using a non-QWERTY keyboard, you may want to change the keybindings in the code to something other than the W, A, S and D keys.
If everything seems to be working, run and submit the CLI tests.