add key logic
This commit is contained in:
@@ -1,15 +1,64 @@
|
||||
package org.project;
|
||||
|
||||
import org.project.entity.enemies.Enemy;
|
||||
import org.project.entity.enemies.Goblin;
|
||||
import org.project.entity.enemies.Skeleton;
|
||||
import org.project.entity.enemies.Vampire;
|
||||
import org.project.entity.players.Assassin;
|
||||
import org.project.entity.players.Knight;
|
||||
import org.project.entity.players.Player;
|
||||
import org.project.entity.players.Wizard;
|
||||
import org.project.item.armors.KnightArmor;
|
||||
import org.project.item.weapons.Sword;
|
||||
import org.project.item.weapons.Weapon;
|
||||
import org.project.location.Location;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
// TODO: ADD LOCATIONS TO YOUR GAME
|
||||
Weapon wp = new Sword(12, 5);
|
||||
ArrayList<Enemy> enemies = new ArrayList<>();
|
||||
enemies.add(new Goblin(100, 100, wp));
|
||||
enemies.add(new Skeleton(50, 100, wp));
|
||||
enemies.add(new Vampire(90, 110, wp));
|
||||
List<Location> locations = new ArrayList<>();
|
||||
locations.add(new Location("Jungle", enemies));
|
||||
Player player;
|
||||
Enemy enemy;
|
||||
int isTurn = 0;
|
||||
Scanner sc = new Scanner(System.in);
|
||||
|
||||
// TODO: IMPLEMENT GAMEPLAY
|
||||
while (true) {
|
||||
System.out.print("1.Assassin\n2.Knight\n3.Wizard\nChoose your Character: ");
|
||||
int choice = sc.nextInt();
|
||||
switch (choice) {
|
||||
case 1:
|
||||
player = new Assassin("Pia", 100, 100, wp, new KnightArmor(50, 1));
|
||||
System.out.println("You chose " + player.getName() + "(Assassin)");
|
||||
break;
|
||||
case 2:
|
||||
player = new Knight("Khan", 200, 100, wp, new KnightArmor(80, 1));
|
||||
System.out.println("You chose " + player.getName() + "(Knight)");
|
||||
break;
|
||||
default:
|
||||
player = new Wizard("Daalou", 90, 100, wp, new KnightArmor(100, 1));
|
||||
System.out.println("You chose " + player.getName() + "(Wizard)");
|
||||
System.out.println();
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void displayLocations(List<Location> locations) {
|
||||
for (Location location : locations) {
|
||||
System.out.println(location);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user