Implemented Fortress enemy spawning, added level save display

This commit is contained in:
Anuken
2017-11-26 23:20:43 -05:00
parent cb9acb7a52
commit 0c6578c229
15 changed files with 45 additions and 16 deletions
@@ -13,6 +13,7 @@ public class BlastEnemy extends Enemy{
speed = 0.65f;
bullet = null;
turretrotatespeed = 0f;
mass = 0.8f;
heal();
}
@@ -36,6 +36,7 @@ public class Enemy extends DestructibleEntity{
protected int spawned = 0;
protected float angle;
protected boolean targetCore = false;
protected float mass = 1f;
public int spawn;
public int node = -1;
@@ -80,18 +81,18 @@ public class Enemy extends DestructibleEntity{
float avoidSpeed = 0.1f;
Entities.getNearby(Entities.getGroup(Enemy.class), x, y, range, other -> {
Enemy enemy = (Enemy)other;
float dst = other.distanceTo(this);
if(other == this)
return;
if(dst < shiftRange){
float scl = Mathf.clamp(1.4f - dst / shiftRange);
float scl = Mathf.clamp(1.4f - dst / shiftRange) * enemy.mass * 1f/mass;
shift.add((x - other.x) * scl, (y - other.y) * scl);
}else if(dst < avoidRange){
Tmp.v2.set((x - other.x), (y - other.y)).setLength(avoidSpeed);
shift.add(Tmp.v2);
}
});
shift.limit(1f);
@@ -7,6 +7,7 @@ public class FastEnemy extends Enemy{
speed = 0.7f;
reload = 30;
mass = 0.2f;
maxhealth = 30;
heal();
@@ -13,6 +13,7 @@ public class FlamerEnemy extends Enemy{
reload = 6;
bullet = BulletType.flameshot;
shootsound = "flame";
mass = 1.5f;
range = 40;
@@ -16,14 +16,15 @@ public class FortressEnemy extends Enemy{
public FortressEnemy(int spawn) {
super(spawn);
speed = 0.1f;
speed = 0.12f;
reload = 90;
maxhealth = 700;
range = 70f;
bullet = BulletType.yellowshell;
hitbox.setSize(9f);
hitbox.setSize(10f);
turretrotatespeed = rotatespeed = 0.08f;
length = 7f;
mass = 7f;
heal();
}
@@ -24,6 +24,7 @@ public class HealerEnemy extends Enemy{
range = 30f;
alwaysRotate = false;
targetCore = false;
mass = 1.1f;
heal();
}
@@ -12,8 +12,9 @@ public class MortarEnemy extends Enemy{
reload = 100f;
bullet = BulletType.shell;
turretrotatespeed = 0.15f;
rotatespeed = 7f;
rotatespeed = 0.05f;
range = 120f;
mass = 1.2f;
heal();
}
@@ -9,11 +9,12 @@ public class RapidEnemy extends Enemy{
reload = 8;
bullet = BulletType.purple;
rotatespeed = 30f;
rotatespeed = 0.08f;
maxhealth = 260;
speed = 0.27f;
heal();
hitbox.setSize(8f);
mass = 3f;
range = 70;
}
@@ -13,8 +13,10 @@ public class TankEnemy extends Enemy{
maxhealth = 350;
speed = 0.2f;
reload = 90f;
rotatespeed = 0.06f;
bullet = BulletType.small;
length = 3f;
mass = 1.4f;
}
void shoot(){
@@ -10,12 +10,13 @@ public class TitanEnemy extends Enemy{
public TitanEnemy(int spawn) {
super(spawn);
speed = 0.1f;
speed = 0.14f;
reload = 30;
maxhealth = 400;
range = 60f;
bullet = BulletType.small;
hitbox.setSize(7f);
mass = 4f;
heal();