Skip to content

nadav78/adventure-game

Repository files navigation

Adventure Game (CSC207 Assignment)

JavaFX-based adventure game completed as part of an undergraduate course assignment.

What this is

  • 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 (.ser files).

The default game configured in the app is TinyGame.

Project layout

  • 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)

Environment used

  • JDK: OpenJDK 20 (as configured in IntelliJ)
  • Java language level: 21 (record patterns, pattern matching for switch)
  • JavaFX SDK: 21

How to run

Option A: IntelliJ IDEA (recommended)

  1. Install a JDK (Java 21 recommended if your project language level is set to 21).

  2. Install JavaFX (OpenJFX SDK). JavaFX is not bundled with most JDKs.

  3. Open the project in IntelliJ.

  4. 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.media

    Example (Windows): --module-path "C:\Program Files\Java\javafx-sdk-21\lib" --add-modules javafx.controls,javafx.fxml,javafx.media

  5. Run AdventureGameApp.

Option B: Command line (outline)

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.)

Tests

BasicAdventureTest.java contains basic JUnit 5 tests.

License

If you plan to share publicly, consider adding a license (e.g., MIT) and ensuring you have the rights to publish all included assets.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages