Skip to content

A simple text-based RPG game written in Java. The player controls a hero who fights randomly generated enemies in turn-based combat. The game includes scoring, saving leaderboard data, and exception handling.

Notifications You must be signed in to change notification settings

Pololac/RPG-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Dungeons & Data โ€” A Java Console RPG

๐ŸŽฎ Dungeons & Data is a simple text-based RPG game developed in Java as part of a programming project. The player controls a hero who battles an endless stream of randomly generated enemies in turn-based combat.


๐Ÿš€ Features

  • Turn-based combat system
  • Random enemy generation (Goblin, Troll, Dragon)
  • Hero abilities: basic attack, special power (mana), healing potion
  • Score tracking with persistent file storage (scores.txt)
  • Leaderboard displaying top players sorted by enemies defeated
  • Exception handling:
    • Invalid menu input
    • Insufficient mana
    • No potions left

๐Ÿ—‚ Technologies

  • Java (JDK 17 recommended)
  • IntelliJ IDEA (or any Java IDE)

๐Ÿ“‚ Project structure

src/
โ”œโ”€โ”€ personnages/      # Hero, Enemy, Goblin, Troll, Dragon classes
โ”œโ”€โ”€ services/         # Game and combat managers
โ”œโ”€โ”€ scores/           # Score management and leaderboard
โ”œโ”€โ”€ exceptions/       # Custom exceptions (invalid choices, mana, potions)
โ””โ”€โ”€ Main.java         # Application entry point

โš” Gameplay

  1. The player enters a name for their hero.
  2. They choose to read the rules, start the game, or view the leaderboard.
  3. During each fight, the player can:
    • Attack the enemy
    • Use a special power (requires mana)
    • Use a healing potion (limited per battle)
  4. After each victory, a new enemy is generated.
  5. The game continues until the hero dies.
  6. The number of defeated enemies is saved to a file and displayed in the leaderboard.

๐Ÿ“„ How to run

  • Compile and run the project via your IDE or directly via terminal:
javac Main.java
java Main

๐Ÿ”ฅ Future improvements (possible extensions)

  • Introduce XP that gives more attack & defense
  • Multiple heroes with different abilities
  • Create a Boss to defeat every 5 wins
  • Difficulty levels

๐Ÿ‘จโ€๐Ÿ’ป Author

  • Created as part of a Java programming training project

Enjoy the game and may your hero defeat many enemies!

About

A simple text-based RPG game written in Java. The player controls a hero who fights randomly generated enemies in turn-based combat. The game includes scoring, saving leaderboard data, and exception handling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages