+ Added Armors

+ Added Weapons
+ Added REPORT.md
+ Finished the classes
+ (fix) Fixed problems caused by class hierarchy
- (todo) main loop, key mechanic.
This commit is contained in:
2026-05-10 17:38:01 +03:30
parent 4e8daa6655
commit deb26fc24f
25 changed files with 305 additions and 116 deletions
@@ -1,15 +1,71 @@
package org.project;
import org.project.entity.enemies.Dragon;
import org.project.location.Location;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
public class Main {
// Colors
private static final String RESET = "\u001B[0m"; // Reset ANSI code
private static final String RED = "\u001B[31m";
private static final String GREEN = "\u001B[32m";
private static final String YELLOW = "\u001B[33m";
private static final String BLUE = "\u001B[34m";
private static final String PURPLE = "\u001B[35m";
public static void main(String[] args) {
// TODO: ADD LOCATIONS TO YOUR GAME
// Scanner
Scanner scanner = new Scanner(System.in);
Random random1 = new Random(112233); // for initial location
Random random2 = new Random(123123); // to choose enemy
// Note : seed numbers don't mean anything (They are just magical numbers)
List<Location> locations = new ArrayList<>();
Location castle = new Location("Castle", new Dragon());
Location forest = new Location("Forest");
Location ruins = new Location("Ruins");
Location village = new Location("Village");
locations.add(castle);
locations.add(forest);
locations.add(ruins);
locations.add(village);
int randNum1 = random1.nextInt() % 3;
int randNum2 = random2.nextInt() % 3;
Location initialPlayerLoc = locations.get(randNum1 + 1); // since the index 0 : castle can't be the player initial location.
// Main loop
boolean isRunning = true;
while (isRunning){
System.out.println(YELLOW + "------------------Legend of AP------------------" + RESET);
System.out.println(" Choose your option :");
System.out.println(BLUE + " 1." + RESET + " Start a new game");
System.out.println(BLUE + " 2." + RESET + " Exit");
int option = scanner.nextInt();
switch (option){
case 1:
case 2:
System.out.println("Goodbye!");
isRunning = false;
break;
default:
continue;
}
}
// TODO: IMPLEMENT GAMEPLAY
}
}