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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user