game.game_manager ================= .. py:module:: game.game_manager .. autoapi-nested-parse:: Main game state management. Classes ------- .. autoapisummary:: game.game_manager.GameManager Module Contents --------------- .. py:class:: GameManager(screen) Manages the overall game state and coordinates all systems. .. py:attribute:: screen .. py:attribute:: game_state :value: 'MAIN_MENU' .. py:attribute:: should_quit :value: False .. py:attribute:: space_key_down :value: False .. py:attribute:: title_font .. py:attribute:: asset_loader .. py:attribute:: main_menu .. py:attribute:: high_scores :value: [] .. py:attribute:: username :value: '' .. py:attribute:: BG_HEIGHT :value: 200 .. py:attribute:: bg_far .. py:attribute:: bg_near .. py:attribute:: session_score_file .. py:attribute:: final_elapsed_time :value: 0 .. py:attribute:: final_score :value: 0 .. py:attribute:: hud .. py:attribute:: tutorial_popup .. py:method:: handle_event(event) Handles all user input and events. .. py:method:: quit_game() Signals the main loop to exit. .. py:method:: start_game(difficulty='medium') Initializes all game systems and starts the game. .. py:method:: restart_game() Resets the game to the main menu without clearing session high scores. .. py:method:: toggle_pause() Toggle game pause state. .. py:method:: send_pig_away() Send one pig to another island. .. py:method:: add_pigs(count) Adds a specified number of new pigs to the island. .. py:method:: emergency_feast() Slaughter half the pigs for a feast. .. py:method:: update(dt) Update game state. .. py:method:: render(screen) Render all game elements.