4.7 KiB
:::writing
Javanest Adventure
Overview
Javanest Adventure is a turn‑based console RPG written in Java.
The player explores different locations, fights monsters, collects keys, and eventually unlocks the castle to confront the final enemy.
The game is inspired by classic text‑based RPGs and demonstrates core object‑oriented programming (OOP) concepts such as inheritance, abstraction, interfaces, and polymorphism.
Story
The peaceful land of Javanest has fallen under a terrible curse.
A powerful Dragon has taken control of the kingdom and unleashed monsters across the land. Villages are abandoned, forests are haunted, and caves are filled with undead creatures.
The dragon locked itself inside the Castle, and the only way to enter is by collecting three hidden keys scattered among the monsters.
Your mission is simple:
- Explore the world
- Defeat monsters
- Collect the keys
- Enter the castle
- Defeat the dragon and free Javanest
Game Features
Turn-Based Combat
Combat is turn-based.
Each round consists of:
- Player turn
- Enemy turn
The battle continues until either the player or the enemy dies.
Player Actions
During each turn the player can choose one of the following actions:
- Attack – perform a normal attack with the equipped weapon
- Use Skill – perform a stronger ability depending on the player class
- Use Item – consume a healing or utility item
- Defend – reduce incoming damage
- Run – attempt to escape the battle
Exploration
The world contains several locations:
- Village (starting area)
- Forest
- Cave
- Dungeon
- Castle (final area)
Players can move between connected locations and may encounter enemies in dangerous areas.
Keys and Progression
The Castle is locked.
To unlock it the player must collect 3 keys.
Keys are obtained by defeating enemies.
Once all keys are collected, the player can enter the Castle and fight the final boss.
Enemies
Enemies are represented by the abstract class Enemy.
Possible enemy types include:
- Skeleton
- Goblin
- Vampire
- Dragon (final boss)
Each enemy has different stats such as:
- Health
- Attack power
- Defense
Player Classes
The player is represented by the abstract class Player, which implements the Entity interface.
Possible subclasses include:
- Knight – high defense and balanced attack
- Wizard – strong magic attacks and mana usage
- Assassin – fast and high critical damage
Each class has different abilities and combat strategies.
Items
Items help the player survive and improve combat performance.
Types of items include:
- Weapon – increases attack damage
- Armor – increases defense
- Consumable – restores health or provides temporary effects
Project Structure
Example structure of the project:
src/
├── Main.java
├── Entity.java
├── Player.java
├── Enemy.java
├── Location.java
│
├── players/
│ ├── Knight.java
│ ├── Wizard.java
│ └── Assassin.java
│
├── enemies/
│ ├── Skeleton.java
│ ├── Goblin.java
│ ├── Vampire.java
│ └── Dragon.java
│
├── items/
│ ├── Item.java
│ ├── Weapon.java
│ ├── Armor.java
│ └── Consumable.java
│
└── utils/
└── ConsoleColors.java
Console Colors
The game uses ANSI colors to improve readability.
| Color | Usage |
|---|---|
| Red | Damage messages |
| Blue | Mana or defense |
| Green | Healing and success |
| Yellow | Warnings and keys |
| Cyan | UI information |
Example:
System.out.println(ConsoleColors.RED + "You took 10 damage!" + ConsoleColors.RESET);
How to Run the Game
Compile
javac *.java
Run
java Main
The game will start in the Village and the player can begin exploring.
Gameplay Loop
Typical gameplay flow:
- Player starts in Village
- Moves to a new location
- Random enemy appears
- Combat begins
- Enemy defeated → possible key drop
- Repeat exploration
- Collect 3 keys
- Enter Castle
- Fight the Dragon
- Win the game
OOP Concepts Used
This project demonstrates several core Java concepts:
- Abstraction
- Inheritance
- Interfaces
- Polymorphism
- Encapsulation
Future Improvements
Possible future features:
- Inventory system
- Equipment upgrades
- Experience and leveling
- More enemy types
- More locations
- Boss mechanics
- Save/load system
Author
Developed as a Java OOP project for practicing game architecture and object‑oriented design. :::