Introduction
Welcome to Java knight, a turn-based RPG inspired by Roguelike games!
What is a Turn-Based Game?
In this combat system, two sides - which are usually the player's side and the enemy's side - attack each other in turns. The side which is not attacking can perform actions to avoid or deflect the enemy's attack.
How To Compile
After downloading the zip file and extracting it, you must first go to the java folder and open the terminal from there. Now type this in the terminal and run it to compile the files:
javac org\project\entity*.java org\project\item*.java org\project\location*.java org\project\Main.java
then, type this and run it for running the game:
java org.project.Main
OOP usage
The design pattern of this project:
- Entity (interface):
Enemies (abstract class): Goblin (class), Skeleton (class), Vampire (class), Dragon (class).
Players (abstract class): Knight (class), Assassin (class), Wizard (class).
- Item (interface):
Armors (abstract class): armlet (class), pauldron (class), helmet (class), cuirass (class).
Weapons (abstract class): dagger (class), bow (class), sword (class), spear (class), halberd (class).
Potions (abstract class): healthPotion (class), strengthPotion (class), mixedPotion (class).
- Location (class).
How To Play
At first enter your character's name (anything you like). After doing so, you may choose your archetype (knight, assassin or wizard). In the next step, the main page will appear in which your level, xp and coins is displayed; there's also a menu and based on the number you enter you will be redirected to one of these:
- Home:
where you can see the lists of items (weapons, armors and potions) you have, upgrade any of them and change your equipment.
- Merchant:
where you can buy weapons and armors you don't already have, or buy potions.
- Play:
by choosing this option, you will be redirected to a random location in which there's a random enemy (vampire, skeleton or goblin). You can skip each location until you find the location and enemy you want. If you lose, you have to start from scratch; no matter how many battles you won before, your xp and level will be 0 again. If you win the battle, you will get coins and some xp. There's also a chance that a key would drop from the enemy you defeated. If so, you grab the key. Each specie has one key, by gathering the three keys there will be an option 4 in the main menu:
- Fight The Dragon:
if you see this option, it means you have got the three keys. By winning this battle, the game will be finished; and by losing this battle, you have to start from scratch like how it's explained before.