An interactive geographic information system (GIS) educational game built with JavaFX. Players use real GIS raster analysis operations to discover hidden treasures across multiple game levels featuring different geographical layers.
Treasure Hunt Game is an educational application that combines gaming with geographic information science. Players navigate through Browns Pond using various GIS operations to analyze vegetation, development, hydrology, and elevation data layers to locate hidden treasures. The game features three progressive levels, each requiring strategic application of local, focal, and zonal raster operations.
- Interactive Map Interface: Click-based navigation with real-time visual feedback on multiple geographical layers
- Comprehensive GIS Operations:
- Local operations (sum, difference, mean, product)
- Focal operations (minimum, maximum, mean, variety) with configurable radius and shape
- Zonal operations (minimum, maximum, mean, count)
- Multiple Geographical Layers: Switch between vegetation, development, hydrology, and elevation data
- Progressive Difficulty: Three distinct game levels with unique challenges and treasure locations
- Hint System: Progressive hints to guide players through GIS problem-solving
- Dynamic Legend: Context-sensitive legend updates based on the active layer
- Gradient Visualization: Automatic color gradient rendering for computed raster values
- Language: Java 11+
- UI Framework: JavaFX 23.0.2.1
- Architecture: Model-View-Controller (MVC) pattern
- Data Format: ASCII Grid (.asc) raster files
- Graphics: Java AWT BufferedImage with JavaFX integration
-
Java Development Kit (JDK): Version 11 or later
- Download from Oracle or use your system's package manager
-
JavaFX SDK: Version 23.0.2.1 or compatible
- Download from Gluon
- Extract to a known location on your system
-
Clone the repository:
git clone https://github.com/yourusername/Project_AG2411.git cd Project_AG2411 -
Download and extract the JavaFX SDK to your preferred location
-
Run the application using the instructions below for your operating system
-
Open Command Prompt (
Windows + R, typecmd, press Enter) -
Navigate to the project directory:
cd C:\path\to\Project_AG2411
-
Run the application (replace the path with your JavaFX SDK location):
java --module-path C:\path\to\javafx-sdk-23.0-2.1\lib --add-modules javafx.controls -jar TreasureHuntGame.jar
-
Open Terminal
-
Navigate to the project directory:
cd /path/to/Project_AG2411 -
Run the application (replace the path with your JavaFX SDK location):
java --module-path /path/to/javafx-sdk-23.0-2.1/lib --add-modules javafx.controls -jar TreasureHuntGame.jar
- Select a Game: Choose from three available games on the welcome screen
- Analyze Layers: Switch between different geographical layers using the layer selection buttons
- Apply Operations: Use GIS operations to analyze and transform the data
- Find the Treasure: Click on the map to search for treasure based on the clues provided
- Use Hints: Request hints if you get stuck (limited per game)
Perform cell-by-cell operations between two layers:
- Sum: Add corresponding cell values from two layers
- Difference: Subtract one layer from another
- Mean: Calculate average of corresponding cells
- Product: Multiply corresponding cell values
Analyze neighborhoods around each cell:
- Minimum: Find minimum value in neighborhood
- Maximum: Find maximum value in neighborhood
- Mean: Calculate average value in neighborhood
- Variety: Count unique values in neighborhood
Configuration options:
- Radius: 1-10 cells
- Shape: Square or circular neighborhood
Compute statistics within zones defined by another layer:
- Minimum: Minimum value within each zone
- Maximum: Maximum value within each zone
- Mean: Average value within each zone
- Count: Number of cells within each zone
Project_AG2411/
├── src/main/
│ ├── java/
│ │ ├── TreasureHuntGame.java # Main application and UI controller
│ │ ├── Layer.java # Raster layer data model and operations
│ │ ├── GetHint.java # Hint system logic
│ │ └── Cell.java # Coordinate data structure
│ └── resources/
│ ├── vegetation.asc # Vegetation layer data
│ ├── development.asc # Development layer data
│ ├── hydrology.asc # Hydrology layer data
│ └── elevation.asc # Elevation layer data
├── bin/ # Compiled classes and resources
├── lib/ # JavaFX libraries
├── TreasureHuntGame.jar # Executable JAR file
└── README.md
- TreasureHuntGame: JavaFX Application entry point, handles UI rendering, event management, and game state
- Layer: Encapsulates raster data and implements all GIS operations (local, focal, zonal)
- GetHint: Manages progressive hint system for each game level
- Cell: Simple data structure representing x,y coordinates
The application uses embedded resources and requires no external configuration files. Game parameters are defined in the TreasureHuntGame class:
- Treasure coordinates and values (per game level)
- Search radius: 5 pixels
- Layer file paths: embedded in resources directory
- Window dimensions: 1000x700 pixels (game view), 400x400 pixels (welcome screen)
- Image Caching: ImageView caching enabled for improved rendering performance
- Efficient Neighborhood Calculation: Optimized algorithms for circular and square neighborhood detection
- HashMap-based Zonal Operations: O(1) zone lookup for fast zonal statistics
- Single-pass Operations: Most raster operations implemented in single iteration
Issue: java command not recognized
- Solution: Add JDK's
bindirectory to your system PATH environment variable
Issue: JavaFX modules not found
- Solution: Verify the
--module-pathpoints to the correctlibdirectory in your JavaFX SDK installation
Issue: Application window appears blank
- Solution: Ensure JavaFX libraries are compatible with your JDK version and operating system
This project is licensed under the MIT License - see the LICENSE file for details.
This project was developed as part of the AG2411 course, demonstrating the practical application of GIS concepts in an interactive educational format.