

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
It would be a massive pain if we had to fit all of our code into a single file. So, let's organize our code into separate modules.
Since each .py file is a module, we can group related functions, variables, and classes together in a module. Then, other modules can import them using the syntax:
from module_name import my_function
# or import everything: from module_name import *
Games often have a lot of magic numbers to represent things like player speeds, item costs, and attack damage. We'll use a dedicated module as a place to store those kinds of constant values.
SCREEN_WIDTH = 1280
SCREEN_HEIGHT = 720
Screen width: 1280
Screen height: 720
Run and submit the CLI tests.