JavaFX-based adventure game completed as part of an undergraduate course assignment.
- A small adventure game engine that loads a game from text files under
Games/<GameName>/. - A JavaFX GUI (images + sound) for playing the game.
- Save/load support via Java serialization (
.serfiles).
The default game configured in the app is TinyGame.
AdventureGameApp.java— JavaFX entry point (main)AdventureModel/— model classes (rooms, player, loader, objects, passages)views/— JavaFX UI (game view + save/load dialogs)Games/TinyGame/— sample game data (rooms, objects, synonyms, help text, assets)Games/Saved/— save files (generated; not meant to be committed)
- JDK: OpenJDK 20 (as configured in IntelliJ)
- Java language level: 21 (record patterns, pattern matching for switch)
- JavaFX SDK: 21
-
Install a JDK (Java 21 recommended if your project language level is set to 21).
-
Install JavaFX (OpenJFX SDK). JavaFX is not bundled with most JDKs.
-
Open the project in IntelliJ.
-
Configure JavaFX VM options for the run configuration of
AdventureGameApp:General template:
--module-path "<PATH_TO_FX_SDK>\lib" --add-modules javafx.controls,javafx.fxml,javafx.mediaExample (Windows):
--module-path "C:\Program Files\Java\javafx-sdk-21\lib" --add-modules javafx.controls,javafx.fxml,javafx.media -
Run
AdventureGameApp.
You’ll need a JDK and a JavaFX SDK, and then compile/run with the JavaFX module path set. (The exact commands vary by OS and JavaFX installation location.)
BasicAdventureTest.java contains basic JUnit 5 tests.
If you plan to share publicly, consider adding a license (e.g., MIT) and ensuring you have the rights to publish all included assets.