Skip to content
Snippets Groups Projects
Commit b534eff4 authored by Laczó Dávid Bence's avatar Laczó Dávid Bence
Browse files

Merge branch 'master' of git.sch.bme.hu:sabvente/akettorony

parents 8d5b8405 a08d8796
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,7 @@ public class GamePanel extends JPanel {
Point fPoint = getFieldAt(new Point(arg0.getX(), arg0.getY()));
final Field f = world.getField(fPoint.x, fPoint.y);
if (f.isRoad() && f.getDefense() == null) {
JMenuItem menuItem = new JMenuItem("Build Obstacle");
JMenuItem menuItem = new JMenuItem("Build Obstacle" + " cost: " + 5);
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
world.getPlayer().buildObstacle(f);
......@@ -119,7 +119,7 @@ public class GamePanel extends JPanel {
});
popup.add(menuItem);
} else if (!f.isRoad() && f.getDefense() == null) {
JMenuItem menuItem = new JMenuItem("Build Tower");
JMenuItem menuItem = new JMenuItem("Build Tower" + " cost: " + 10);
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
world.getPlayer().buildTower(f);
......@@ -130,7 +130,7 @@ public class GamePanel extends JPanel {
final IUpgradeable u = f.getDefense();
ArrayList<IMagicrock> mrs = u.getAvailableMagicRocks();
for (final IMagicrock mr : mrs) {
JMenuItem menuItem = new JMenuItem(mr.getDisplayName());
JMenuItem menuItem = new JMenuItem(mr.getDisplayName() + " cost: " + mr.getCost());
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
world.getPlayer().upgradeDefense(u, mr);
......
......@@ -7,7 +7,7 @@ import interfaces.IUpgradeable;
public class Player implements IEnemyObserver
{
private int magic;
private final int enemyMagic = 1;
private final int enemyMagic = 5;
public Player()
{
......
......@@ -37,8 +37,9 @@ public class SpawnManager implements ITickable, IEnemyObserver
private int nextSpawnNum()
{
int num = (int) Math.round(Math.pow((currentTime / 120.f), 2));
int num = (int) Math.round(Math.pow((currentTime / 300.f), 2));
num = num < 1 ? 1 : num;
num = num > 5 ? 5 : num;
if (enemiesLeft < num) {
num = enemiesLeft;
}
......@@ -105,6 +106,7 @@ public class SpawnManager implements ITickable, IEnemyObserver
spawnEnemies();
spawnTimeLeft = nextSpawnTime();
}
currentTime++;
}
public void enemyMoved(Enemy enemy)
......
......@@ -42,7 +42,7 @@ public class Tower extends Placeable implements ITickable, IEnemyObserver,
damage.put(EnemyType.ELF, 20);
damage.put(EnemyType.HOBBIT, 20);
enemiesInRange = new ArrayList<Enemy>();
recoilTime = 10;
recoilTime = 5;
range = 1;
}
......@@ -98,6 +98,7 @@ public class Tower extends Placeable implements ITickable, IEnemyObserver,
continue;
enemiesInRange.addAll(field.getEnemies());
}
target = null;
}
public void enemyDied(Enemy enemy) {
......@@ -112,7 +113,7 @@ public class Tower extends Placeable implements ITickable, IEnemyObserver,
public void tick() {
if (!fogDescends) {
if ((new Random()).nextInt(100) % 20 == 0) {
if ((new Random()).nextInt(50) == 0) {
fogDescends = true;
fogTimeLeft = 3 + (new Random()).nextInt(20);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment