physics-board-game-delphi
Grade 10 Practical Assessment Task (PAT)
- Active · last change 6-11-2026
- ★ 1 on GitHub
README
🎲 Physics Educational Board Game Simulation (Phizfun)
A desktop-based educational board game application designed to gamify physics concepts through interactive mechanics, role-based player configurations, and local session tracking. Built as a foundational software engineering project exploring multi-layer UI flow and logic structures.
⚙️ Core Architecture & Tech Stack
- Language/Framework: Delphi (Object Pascal) / VCL Desktop GUI Framework
- Paradigm: Object-Oriented Event-Driven Programming
- Target OS: Windows Desktop
🎮 Game Mechanics & Rules Engine
The application models a traditional turn-based board game mapped to computational evaluation loops:
- Player Configuration: Dynamic initialization supporting 1 to 2 players (optimized for local multi-player seating configurations).
- Difficulty Scalability: Three distinct game modes—Easy, Medium, and Hard—which dynamically scale the algorithmic complexity and subject matter of the evaluation query pool.
- The Core Gameplay Loop:
- The active player triggers a pseudo-randomized Dice Roll engine.
- The system intercepts the turn, freezes board states, and fetches an environment-appropriate physics question.
- Conditional Logic Verification: If the player inputs the correct response, the rule engine moves their game piece forward by the exact coordinate index showing on the dice. Incorrect answers forfeit the turn, passing state control to the next sequential player.
🖼️ Application Form Architecture & UI Layout
The application's user experience is split across five decoupled VCL Forms, mapping out a structured state machine from initialization to gameplay resolution:
| Form State | Interface Description | Preview Asset |
|---|---|---|
| 1. Registration | Captures new player credentials and appends data streams to the local repository. | ![]() |
| 2. Login | Verifies player credentials against saved data to initialize local session profiles. | ![]() |
| 3. Difficulty Selection | Configures the application logic parameters to scale query complexity (Easy / Medium / Hard). | ![]() |
| 4. Core Board Game | Manages turn-based sequential execution logic, dice mechanics, and coordinate grid mapping. | ![]() |
| 5. Question Evaluation | Intercepts gameplay states via interactive modal prompts to validate physics subject mastery. | ![]() |
Note: Graphic asset binaries within the main board and question forms fail to resolve dynamically at runtime due to absolute environment path configurations on the legacy build, but the underlying UI structures are preserved above.
🔍 Historical Retrospective & Known Issues
This repository is preserved in its original state to document my early development history and software engineering timeline. Because it is an un-refactored archive project, the following legacy system execution bugs remain present as historical artifacts:
1. I/O Error 32 (Sharing Violation)
- Symptom: Occurs intermittently during specific registration paths or session initiation sequences.
- Root Cause Analysis: A resource management flaw where an execution or exception path exits the registration scope prior to invoking the
CloseFile()handle. Windows preserves an active file-lock on the local text stream asset, causing subsequent lookups to throw a sharing violation. - Modern Resolution: If refactored today, this file-handling routine would be completely wrapped inside a strict structural
try...finallyresource block to strictly guarantee file handle releases regardless of execution health.
2. UI Debugging Artifacts (Residual Modals)
- Symptom: A generic text
ShowMessagebox pops up displaying the explicit question index number to the player right before loading an evaluation prompt. - Root Cause Analysis: A development-stage tracing tool intentionally left active in the production code path to verify variable incrementation inside the question-fetching loop.
- Modern Resolution: Removal of the redundant VCL modal call, routing background indices strictly to local logs or terminal debug pipelines.
3. Absolute File Pathing (Image Resolution Failure)
- Symptom: Text-based physics prompts render correctly, but corresponding graphical binary illustrations fail to populate the graphic UI boxes.
- Root Cause Analysis: The legacy system utilizes rigid, hardcoded absolute file paths bound entirely to the original local directory tree of the development machine. When deployed externally, the file system fails to resolve the asset paths.
- Modern Resolution: Absolute strings would be replaced with dynamic environment parameter extraction using
ExtractFilePath(ParamStr(0)) + 'Assets/Images/', rendering the distribution asset-portable across filesystems.






