We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Reading the Docs

This project will depend heavily on the Pygame API. We'll use it to open a window, draw shapes, handle keyboard input, and respond to game events.

That's the whole point of using a third-party library: Pygame handles the game-programming infrastructure, going far beyond what the Python standard library provides, so that we can focus on the game we're actually building.

Docs Are Reference Material

You can't (and shouldn't try to) memorize every function, class, and method in every library you use. That's what documentation is for.

Docs are typically not meant to be read from top to bottom like a book. Use them to answer specific questions:

  • What module contains the thing I need?
  • What arguments does it take?
  • What does it return?
  • Is there an example?

Pygame's docs might feel different from the Python docs you've seen before, and that's normal. Every library has its own API, vocabulary, and documentation style.

Why Won't You Just Teach Me?

We'll give you plenty of guidance in this project, but we won't spoon-feed every Pygame detail. We want you to learn how to read documentation. It may be intimidating because it's unfamiliar, but it's not actually that hard.

In the real world, you'll be reading a lot of docs, and you won't always have a tutorial or a course to help you out.

Assignment

Open the Pygame docs and find the entry for pygame.display.set_mode(). I recommend using the search bar and just entering set_mode.

Copy the function signature itself, not an example call, and paste it into the text box, then submit. It's the line that starts with set_mode( and includes the return type after ->.