game.game_manager

Main game state management.

Classes

GameManager

Manages the overall game state and coordinates all systems.

Module Contents

class game.game_manager.GameManager(screen)[source]

Manages the overall game state and coordinates all systems.

screen[source]
game_state = 'MAIN_MENU'[source]
should_quit = False[source]
space_key_down = False[source]
title_font[source]
asset_loader[source]
main_menu[source]
high_scores = [][source]
username = ''[source]
BG_HEIGHT = 200[source]
bg_far[source]
bg_near[source]
session_score_file[source]
final_elapsed_time = 0[source]
final_score = 0[source]
hud[source]
tutorial_popup[source]
handle_event(event)[source]

Handles all user input and events.

quit_game()[source]

Signals the main loop to exit.

start_game(difficulty='medium')[source]

Initializes all game systems and starts the game.

restart_game()[source]

Resets the game to the main menu without clearing session high scores.

toggle_pause()[source]

Toggle game pause state.

send_pig_away()[source]

Send one pig to another island.

add_pigs(count)[source]

Adds a specified number of new pigs to the island.

emergency_feast()[source]

Slaughter half the pigs for a feast.

update(dt)[source]

Update game state.

render(screen)[source]

Render all game elements.