I built a text‑based adventure game where the player explores a haunted house and tries to find a way out.
Originally a school assignment, Haunted House evolved into a project where I focused on building a clean, modular game engine grounded in real software‑engineering principles. Even though it’s a simple text-based adventure game on the surface, the project pushed me to think about architecture, state management, and scalability. Every part of the game — rooms, items, commands, player stats — is modeled as its own object, making the system easy to maintain and extend.
I also wanted to explore how a traditional CLI game could be adapted for the web. The backend exposes a small REST API that accepts the same text commands as the command‑line version, and the browser UI acts as a lightweight terminal that sends commands to the engine. This separation of concerns made it possible to reuse the same Java engine for both interfaces.
The project gave me hands‑on experience with Spring Boot, REST design, Dockerized development, and writing clean, maintainable Java code with complete Javadoc documentation. It’s a small game, but it reflects real engineering decisions and a focus on clarity, structure, and maintainability.
Play Haunted House
(Runs in your browser with no installation required.)
If you'd like to explore the source code or run the engine on your own machine, you can launch the full stack (Java backend + web frontend) using either Docker or Maven.
git clone https://github.com/bdtripp-dev/haunted-house.git
cd haunted-houseYou can run the application using Docker (production‑like environment) or Maven (best for active development).
This builds and runs the application in a clean, reproducible environment.
docker build -t haunted-house .
docker run -p 8080:8080 haunted-houseUses the Maven Wrapper so the project builds even if Maven isn’t installed globally.
./mvnw spring-boot:runOnce the application starts, open your browser to:
This loads the web‑based terminal interface.
Here’s what the game looks like in action:
go: move to another room. Type go + "space" + "a direction"
Hint: Directions are north, south, east, or west
help: get info on how to play the game and a list of all the commands
look: get a description of your location and directions that you are able to move
items: print a list of items that you are carrying and descriptions of each item
stats: print a list of the player's current stats
quit: Use to quit the program
- Languages:
- Front-end: HTML, CSS, JS
- Back-end: Java
- Framework: Spring Boot
- DevOps / Workflow: Docker, Dev Container, GitHub Actions
-
Designed a modular game engine using object‑oriented principles where rooms, items, commands, and player state are modeled as independent components with clear responsibilities.
-
Implemented a command‑parsing system that maps user input to executable game actions, making it easy to add new commands without modifying existing logic.
-
Separated engine logic from the UI layer, enabling the same Java backend to power both the CLI version and the fully custom web‑based terminal UI.
-
Built a REST API that exposes game actions (
/start,/command) and returns structured JSON responses for the browser client. -
Used Spring Boot’s dependency injection to wire together the controller, service layer, and game engine, keeping components loosely coupled and easy to test or replace.
-
Containerized the application with Docker to ensure consistent local development and deployment environments.
-
Set up GitHub Actions CI/CD to automatically build and deploy the project on each push.
-
Wrote complete Javadoc documentation to make the engine understandable, maintainable, and easy to extend.
