Skip to content

mirotvoretts/horror_mvp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Horror Game :: Patterns practice

License Unity Version

A simple 3D horror game. You have to collect all the keys on the map before the Evil Pumpkin catches you

This education project demonstrates the implementation of Model-View-Presenter (MVP) architectural pattern along with Composite Root in Unity

Controls

  • WASD (Movement)
  • Mouse (Camera)

Code structure

Scripts/
├── CompositeRoot/ - Composition root that wires all components together
├── Input/ - Input handling system
├── Model/ - Game data and business logic (pure classes)
├── System/ - Core systems and services
└── View/ - Presentation layer (Unity GameObjects and UI)

Key Patterns Used

Model-View-Presenter (MVP)

In this project:

  • Model: Contains game data and business logic (domain layer)
  • View: Handles visual representation and user input (presentation layer)
  • Presenter: Mediates between Model and View (application logic layer)

Composite Root

The Composite Root pattern is used to:

  • Centralize object composition
  • Manage dependencies between components
  • Initialize the entire object graph in one place

How It Works

  1. Initialization:

    • The CompositeRoot script creates and wires all components together
    • It resolves dependencies between systems, models, and presenters
  2. Data Flow:

    • User input is captured by the Input system
    • Input events are processed by presenters
    • Presenters update the Model and notify the View
    • View reflects the current state from the Model

About

Simple 3D horror in Unity for practice of using MVP pattern and Composite roots

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors