How gigores/the-factory-must-grow works
TheFactoryMustGrow is a factory-building game centered on exploring and generating a world, collecting resources, crafting and placing production buildings, and expanding an industrial network. The runtime starts in the menu, then runs the game scene with player, inventory, world, entities, and UI state; saves preserve that state. The README highlights realistic metallurgy and chemistry, reflected in the building and recipe systems. Several subsystems are represented by their exact directories because their individual files were not sampled; edges are limited to relationships supported by excerpts, the source index, or documentation.
Main entry points: main.py Game loop · GameScene.py Game scene · BaseUIComponents.py UI components · SavesManager.py Save manager
Components 25
Game runtime
- Game loop
main.py - Main menu
scripts/Scenes/MainMenuScene.py - Game scene
scripts/Scenes/GameScene.py - Vector and rendering helpers
PgHelp.py
World and entities
- Player
scripts/Entities/Player.py - World generator
scripts/Generators/WorldGenerator.py - Entity manager
scripts/Managers/EntityManager.py - Natural resources
scripts/Entities/Natural
Factory systems
- Assets and recipes
scripts/Managers/GameAssets.py - Item definitions
scripts/Classes/ItemClasses.py - Factory buildings
scripts/Entities/Buildings - Building behavior
scripts/Entities/ABC/Building.py - Electric network
scripts/Entities/ABC/ElectricNode.py - Walls
scripts/Entities/ABC/Wall.py - Entity registry
scripts/Classes/Registry/EntityRegistry.py
Game state
- Inventory
scripts/Managers/IngameManagers/Inventory.py - Save manager
scripts/Managers/SavesManager.py - Settings
scripts/Managers/SettingsManager.py - Achievement tracking
scripts/Managers/IngameManagers/AchievementsVisualsManager.py
Player interface
- Building interfaces
scripts/UI/Entities - UI components
scripts/UI/Components/BaseUIComponents.py - Dark theme components
scripts/UI/Components/DarkThemeComponents.py - Map and inventory UI
scripts/UI/MapUI.py - In-game terminal
scripts/UI/Terminal/Enterpreter.py
Other components
- Player
Connections 34
- Player → Main menu: starts game
README.md - Game loop → Main menu: runs scene
main.py - Game loop → Game scene: runs scene
main.py - Game loop → Assets and recipes: loads assets
main.py - Game loop → World generator: creates generator
main.py - Game loop → Entity manager: creates manager
main.py - Game loop → Save manager: creates manager
main.py - Game loop → Settings: creates manager
main.py - Game loop → Inventory: creates inventories
main.py - Game loop → Achievement tracking: creates manager
main.py - Game loop → Player: creates player
main.py - Game loop → Vector and rendering helpers: uses helpers
main.py - Game scene → Walls: imports
scripts/Scenes/GameScene.py - Game scene → Electric network: references
scripts/Scenes/GameScene.py - Game scene → Inventory: uses inventory
main.py - Game scene → Entity manager: uses manager
main.py - World generator → Factory buildings: places entities
scripts/Generators/WorldGenerator.py - World generator → Natural resources: generates resources
- Entity manager → Building behavior: indexes entities
scripts/Managers/EntityManager.py - Entity manager → Electric network: groups network nodes
scripts/Managers/EntityManager.py - Factory buildings → Building behavior: extends behavior
scripts/Entities/Buildings/Workbench.py - Factory buildings → Entity registry: registers classes
scripts/Entities/Buildings/Workbench.py - Building behavior → Assets and recipes: uses assets
scripts/Entities/ABC/Building.py - Building behavior → Inventory: uses inventory
scripts/Entities/Buildings/Workbench.py - Assets and recipes → Item definitions: loads definitions
scripts/Managers/GameAssets.py - Save manager → Player: restores state
scripts/Managers/SavesManager.py - Save manager → Inventory: restores state
scripts/Managers/SavesManager.py - Save manager → Achievement tracking: restores state
scripts/Managers/SavesManager.py - Achievement tracking → UI components: renders splash
scripts/Managers/IngameManagers/AchievementsVisualsManager.py - Building interfaces → UI components: uses components
scripts/UI/Entities/EngineeringWorkbenchUI.py - Dark theme components → UI components: extends components
scripts/UI/Components/DarkThemeComponents.py - In-game terminal → Assets and recipes: uses assets
scripts/UI/Terminal/Enterpreter.py - In-game terminal → UI components: uses components
scripts/UI/Terminal/__init__.py - Map and inventory UI → UI components: uses components