This project showcases a Unity game designed to highlight my skills in C# programming, game architecture, and the implementation of advanced patterns such as State Machine, Abstract Factory, and Service Locator. The game includes systems for player movement, progression, resource management, and a robust game loop, all designed with scalability and maintainability in mind.
- IdlePrototype/Assets/_Project/: Root directory containing the Unity project files.
- IdlePrototype/Assets/_Project/Scripts: Game logic and architecture scripts.
- IdlePrototype/Assets/Resources: Key game assets
- IdlePrototype/Assets/ThirdPartyContent: Plugins, asset packs, etc.
- W, A, S, D: Movement keys for player navigation.
-
GameRunner: Ensures the presence of a
GameEntryPointBootstrap
. If absent, it adds aBootstrapper
prefab to the scene. -
GameEntryPointBootstrap:
- Creates the
Game
instance. - Initializes
GameStateMachine
. - Enters
BootstrapState
.
- Creates the
-
BootstrapState:
- Registers all services.
- Starts the game from the
InitialScene
. - Asynchronously loads the next scene.
-
LoadProgressState:
- Loads existing progress or initializes new
PlayerProgress
. - Prepares the
Main
scene for loading.
- Loads existing progress or initializes new
-
LoadLevelState:
- Initializes UI (
UIFactory
). - Initializes game world (
GameFactory
). - Notifies progress readers.
- Initializes UI (
-
GameLoopState:
- Core gameplay state.
-
LootSpawner:
- Subscribes to
BuildingProduce.Happened
event inStart()
.
- Subscribes to
-
BuildingProduce:
- Generates resources and triggers the
Happened
event.
- Generates resources and triggers the
-
Spawn Loot:
LootSpawner
reacts toHappened
and invokesSpawnLoot()
.
-
Loot Creation:
GameFactory
instantiatesLootComponent
.
-
Loot Details:
Loot
class: Defines the size and properties of loot.LootPiece
component: Manages loot behavior on the stage.
-
PersistentProgressService:
- Centralized reference for player's progress.
-
PlayerProgress:
- Stores user data relevant to gameplay progression.
-
State Machine:
GameStateMachine
: Manages game states (BootstrapState
,LoadProgressState
,LoadLevelState
,GameLoopState
).
-
Abstract Factory:
GameFactory
: Handles object creation in the game scene.UIFactory
: Handles UI creation in the game scene.
-
Service Locator:
AllServices
: Maps services to their implementations for easy access.
- Asynchronous scene loading for smooth transitions.
- Modular architecture designed for scalability.
- Integration of modern programming patterns for clean and maintainable code.
Name | Description |
---|---|
init | Start a project/task |
build | Project build or changes in external dependencies |
sec | Security and vulnerability fixes |
ci | CI configuration and script updates |
docs | Documentation updates |
feat | Adding new functionality |
fix | Bug fixes |
perf | Changes aimed at improving performance |
refactor | Code refactoring without fixing bugs or adding new features |
revert | Reverting previous commits |
style | Code style fixes (tabs, indents, dots, commas, etc.) |
test | Adding tests |
chore | Changes to the build process or auxiliary tools and libraries |