A roguelike dungeon crawler built in Java using the ISCTE GraphPack GUI framework. Navigate through interconnected rooms, fight enemies, collect items, and aim for the highest score.
Developed for the Object-Oriented Programming (POO) course at ISCTE.
- Explore rooms on a 10x10 tile grid, moving the hero with arrow keys
- Fight enemies (Skeletons, Bats, Thugs, Scorpions, Thieves) in turn-based combat
- Collect items — swords, armor, healing potions, keys, and treasure
- Unlock doors with matching keys to progress between rooms
- Manage a 3-slot inventory: drop items (1/2/3) or use them (Q/W/E)
- Save & Load your progress at any point
- Hall of Fame — top 5 scores are persisted across sessions
src/pt/iscte/poo/example/
│
├── Engine.java # Game loop, input handling, turn management (Singleton + Observer)
├── Level.java # Room loading from text files, element tracking, save/load
├── Main.java # Entry point
│
├── GameElement.java # Abstract base — position + ImageTile implementation
│ ├── Entity.java # Abstract — HP, attack, movement, collision, pathfinding
│ │ ├── Hero.java # Player character — inventory, interactions, poison, save state
│ │ ├── Skeleton.java # Enemy type
│ │ ├── Bat.java # Enemy type
│ │ ├── Thug.java # Enemy type
│ │ ├── Scorpio.java # Enemy type
│ │ └── Thief.java # Enemy type
│ ├── Item.java # Abstract — collect, use, drop, factory method
│ │ ├── Sword.java # Increases attack power
│ │ ├── Armor.java # Chance to block damage
│ │ ├── HealingPotion.java # Restores HP and cures poison
│ │ ├── Key.java # Unlocks matching doors
│ │ └── Treasure.java # Score bonus
│ ├── Door.java # Open/closed state, links rooms, optional key requirement
│ ├── Wall.java # Impassable terrain
│ └── Floor.java # Walkable terrain
│
├── Inventory.java # 3-slot item management with GUI rendering (Singleton)
├── HealthBar.java # Visual HP display
├── HallOfFame.java # Top 5 leaderboard with file persistence (Singleton)
│
├── Interactable.java # Interface — interactsWith(GameElement)
├── Movable.java # Interface — move(Direction...), extends Interactable
├── Collectable.java # Interface — collect(), use(), drop(), extends Interactable
└── Enemy.java # Marker interface for enemy identification
- Singleton —
Engine,Inventory, andHallOfFameensure single instances - Observer —
Engineobserves GUI keyboard events via the GraphPackObserverinterface - Factory Method —
Entity.create()andItem.create()instantiate concrete types from room file data - Marker Interface —
Enemytags enemy entities for filtering without adding methods
Levels are defined as text files in rooms/. Each file contains:
- A 10x10 ASCII grid (
#= wall, space = floor) - Entity/item/door definitions with position and parameters
##########
#
#
#
Skeleton,1,6
Bat,3,7
Sword,8,8
Key,8,2,KEY0
Door,9,4,room2,0,4,KEY2
Door,4,9,room1,4,0,KEY0
| Key | Action |
|---|---|
| Arrow keys | Move hero |
| 1 / 2 / 3 | Drop inventory slot |
| Q / W / E | Use inventory slot |
- Java 8+
- GraphPack library (included in
GraphPack_2022_2023_V1_1/)
Compile and run Main.java with the GraphPack source on the classpath:
javac -cp "GraphPack_2022_2023_V1_1/src" Rogue_Joao_105377_Tiago_105475/src/pt/iscte/poo/example/*.java
java -cp "GraphPack_2022_2023_V1_1/src:Rogue_Joao_105377_Tiago_105475/src" pt.iscte.poo.example.MainOr open the project in IntelliJ IDEA (project files included).
- Joao Marques
- Tiago Lobo