added docstrings to every file and function. (with claude, checked it)

tower and game_play dont meet pylint check yet.
This commit is contained in:
2026-07-15 22:16:18 +02:00
parent 367a839c8a
commit 821aa2e8a4
9 changed files with 428 additions and 109 deletions
+18 -4
View File
@@ -1,9 +1,18 @@
"""Main menu screen - title label and Play/Quit navigation."""
import sys
import pygame_gui as pgi
import pygame as pg
from game.screens.base_screen import BaseScreen
import pygame as pg
import pygame_gui as pgi
class MainMenu(BaseScreen):
"""The main menu screen with a title, Play button, and Quit button.
Attributes:
title (pgi.elements.UILabel): The menu title label.
play_button (pgi.elements.UIButton): Transitions to the gameplay screen.
quit_button (pgi.elements.UIButton): Exits the application.
"""
def __init__(self, game):
super().__init__(game)
@@ -66,6 +75,11 @@ class MainMenu(BaseScreen):
]
def process_event(self, event):
"""Handle Play and Quit button presses.
Args:
event (pg.event.Event): The pygame event to process.
"""
if event.type == pgi.UI_BUTTON_PRESSED:
@@ -75,4 +89,4 @@ class MainMenu(BaseScreen):
if event.ui_element == self.quit_button:
pg.quit()
exit()
sys.exit()