Fixed: missing spawns / incorrect ranks / jittery movement / tests

This commit is contained in:
Anuken
2019-02-23 15:08:07 -05:00
parent d74887eaa1
commit 976b39414f
15 changed files with 65 additions and 40 deletions

View File

@@ -10,7 +10,7 @@ public class DefaultWaves{
private static Array<SpawnGroup> spawns;
public static Array<SpawnGroup> getDefaultSpawns(){
if(spawns == null){
if(spawns == null && UnitTypes.dagger != null){
spawns = Array.with(
new SpawnGroup(UnitTypes.dagger){{
end = 8;
@@ -164,6 +164,6 @@ public class DefaultWaves{
}}
);
}
return spawns;
return spawns == null ? new Array<>() : spawns;
}
}

View File

@@ -28,5 +28,5 @@ public class Rules{
/**Zone ID, -1 for invalid zone.*/
public byte zone = -1;
/**Spawn layout. Since only zones modify this, it should be assigned on save load.*/
public transient Array<SpawnGroup> spawns = new Array<>();
public transient Array<SpawnGroup> spawns = DefaultWaves.getDefaultSpawns();
}

View File

@@ -30,7 +30,7 @@ public class Stats{
//each new launch period adds onto the rank 1.5 'points'
if(wavesLasted >= zone.conditionWave){
score += (float)((zone.conditionWave - wavesLasted) / zone.launchPeriod + 1) * 1.5f;
score += (float)((wavesLasted - zone.conditionWave) / zone.launchPeriod + 1) * 1.5f;
}
int capacity = zone.generator.coreBlock.itemCapacity;