A turn-based maze exploration game written in Java where players navigate through a labyrinth, battle monsters, collect weapons and shields, and race to find the exit.
Irrgarten (German for "maze" or "labyrinth") is a strategic turn-based game where players explore a procedurally generated 10×10 labyrinth. Players must navigate through obstacles, engage in combat with monsters, manage their inventory of weapons and shields, and be the first to reach the exit to win.
- Turn-based Gameplay: Players take turns moving through the labyrinth
- Combat System: Engage in strategic combat with monsters using weapons and shields
- Inventory Management: Collect and manage weapons (max 2) and shields (max 3)
- Character Stats: Each player has intelligence, strength, and health attributes
- Resurrection Mechanic: Dead players can be resurrected as "Fuzzy Players" with randomized behavior
- Multiple Difficulty Levels: Three difficulty settings (Easy, Normal, Hard) affecting monster and obstacle density
- Dual UI Support: Both graphical (Swing GUI) and text-based interfaces
- Procedural Generation: Randomly generated labyrinths with obstacles and monster placement
- Java: Core programming language
- Java Swing (javax.swing): Graphical user interface
- Apache Ant: Build system (build.xml)
- NetBeans IDE: Development environment (project structure)
irrgarten_java/
├── src/
│ ├── irrgarten/ # Core game logic
│ │ ├── Game.java # Main game controller
│ │ ├── Player.java # Player character
│ │ ├── Monster.java # Monster enemies
│ │ ├── Labyrinth.java # Maze structure
│ │ ├── FuzzyPlayer.java # Resurrected player variant
│ │ ├── Dice.java # Random number generation
│ │ ├── Weapon.java # Weapon items
│ │ ├── Shield.java # Shield items
│ │ └── ...
│ ├── UI/ # User interface
│ │ ├── UI.java # Interface definition
│ │ ├── GuiUI.java # Swing GUI implementation
│ │ └── TextUI.java # Text-based UI
│ ├── controller/ # Game controller (MVC pattern)
│ │ └── Controller.java
│ └── main/ # Entry point
│ └── main.java
├── build.xml # Ant build configuration
└── nbproject/ # NetBeans project files
- Intelligence: Affects defensive capabilities and movement decision-making
- Strength: Determines attack power
- Health: Starting health is 10; players die when health reaches 0 or after 3 consecutive hits
- Turn-based combat with up to 10 rounds per encounter
- Players attack using strength + weapon bonuses
- Defense uses intelligence + shield bonuses
- Winners receive rewards: weapons, shields, and health bonuses
- Weapons: Provide attack bonuses, have limited uses (max 5), can be discarded
- Shields: Provide defense bonuses, have limited uses (max 5), can be discarded
- Players can carry a maximum of 2 weapons and 3 shields
- Players die when health reaches 0 or after 3 consecutive hits
- Dead players have a 30% chance to be resurrected each turn
- Resurrected players become "Fuzzy Players" with randomized behavior
- The first player to reach the exit (marked with 'E') wins the game
- Java Development Kit (JDK) 8 or higher
- Apache Ant (optional, for build.xml)
- Open the project in NetBeans IDE
- Build the project (F11)
- Run the project (F6)
ant compile # Compile the project
ant run # Run the game
ant clean # Clean build files# Compile
javac -d build/classes -sourcepath src src/main/main.java
# Run
java -cp build/classes main.main- Start the Game: Run the main class to begin
- Choose Direction: Use the GUI controls or text interface to select movement direction (UP, DOWN, LEFT, RIGHT)
- Navigate: Move through the labyrinth, avoiding obstacles (X) and monsters (M)
- Combat: When encountering a monster, combat is automatic based on your stats and equipment
- Collect Rewards: Winning combat grants weapons, shields, and health
- Reach the Exit: Be the first player to reach the exit (E) to win!
-: Empty cellX: Block/obstacleM: MonsterC: Combat in progressE: Exit0,1,2, ... : Player numbers
The project follows the Model-View-Controller (MVC) pattern:
- Model:
Game,Player,Monster,Labyrinthclasses handle game logic - View:
UIinterface withGuiUIandTextUIimplementations - Controller:
Controllerclass manages game flow and user input
- The game supports multiple players (configured in
main.java) - Debug mode is available by setting
debug = trueinmain.java - The labyrinth is randomly generated each game
- Difficulty level affects the number of monsters and obstacles (currently set to Normal in code)