Globals Module
Globals
A class to store global variables and configuration constants for the game.
Attributes:
Name | Type | Description |
---|---|---|
running |
bool
|
Indicates if the game loop is running. |
FRAMES_PER_SECOND |
int
|
The target frames per second for the game. |
SCREEN_WIDTH |
int
|
The width of the game window. |
SCREEN_HEIGHT |
int
|
The height of the game window. |
SCORE |
int
|
The player's current score. |
LIVES |
int
|
The starting number of lives for the player. |
window_name |
str
|
The display name of the game window. |
levels |
list
|
The ordered list of level names. |
start_level |
int
|
The index of the starting level. |
end_game_level |
int
|
The index of the level to jump to when the game ends. |
next_level |
int
|
The index of the next level to load. |
exiting |
bool
|
Indicates if the game is exiting. |
total_count |
int
|
User-defined global variable for total count. |
destroyed_count |
int
|
User-defined global variable for destroyed count. |
Source code in GameFrame/Globals.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|