Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Irrgarten (Labyrinth Game)

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.

Overview

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.

Features

  • 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

Technologies

  • Java: Core programming language
  • Java Swing (javax.swing): Graphical user interface
  • Apache Ant: Build system (build.xml)
  • NetBeans IDE: Development environment (project structure)

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

Game Mechanics

Character Attributes

  • 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

Combat System

  • 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

Items

  • 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

Death and Resurrection

  • 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

Victory Condition

  • The first player to reach the exit (marked with 'E') wins the game

Building and Running

Prerequisites

  • Java Development Kit (JDK) 8 or higher
  • Apache Ant (optional, for build.xml)

Using NetBeans

  1. Open the project in NetBeans IDE
  2. Build the project (F11)
  3. Run the project (F6)

Using Ant

ant compile    # Compile the project
ant run        # Run the game
ant clean      # Clean build files

Using Java directly

# Compile
javac -d build/classes -sourcepath src src/main/main.java

# Run
java -cp build/classes main.main

How to Play

  1. Start the Game: Run the main class to begin
  2. Choose Direction: Use the GUI controls or text interface to select movement direction (UP, DOWN, LEFT, RIGHT)
  3. Navigate: Move through the labyrinth, avoiding obstacles (X) and monsters (M)
  4. Combat: When encountering a monster, combat is automatic based on your stats and equipment
  5. Collect Rewards: Winning combat grants weapons, shields, and health
  6. Reach the Exit: Be the first player to reach the exit (E) to win!

Game Symbols

  • - : Empty cell
  • X : Block/obstacle
  • M : Monster
  • C : Combat in progress
  • E : Exit
  • 0, 1, 2, ... : Player numbers

Architecture

The project follows the Model-View-Controller (MVC) pattern:

  • Model: Game, Player, Monster, Labyrinth classes handle game logic
  • View: UI interface with GuiUI and TextUI implementations
  • Controller: Controller class manages game flow and user input

Notes

  • The game supports multiple players (configured in main.java)
  • Debug mode is available by setting debug = true in main.java
  • The labyrinth is randomly generated each game
  • Difficulty level affects the number of monsters and obstacles (currently set to Normal in code)

About

Irrgarten es un juego en el que varios jugadores deben conseguir escapar de una laberinto. Un laberinto se construye sobre un tablero de juego rectangular (o cuadrado) dividido en casillas en el que los jugadores son situados al azar al inicio del juego. Ganará el primer jugador que alcance la casilla de salida.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages