Implemented JPS badly
This commit is contained in:
@@ -1,25 +1,13 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import com.badlogic.gdx.ai.pfa.Heuristic;
|
||||
import io.anuke.mindustry.ai.Heuristics.DestrutiveHeuristic;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.Turret;
|
||||
import io.anuke.mindustry.world.blocks.types.distribution.Conveyor;
|
||||
import io.anuke.mindustry.world.blocks.types.distribution.Router;
|
||||
import io.anuke.mindustry.world.blocks.types.production.Drill;
|
||||
import io.anuke.mindustry.world.blocks.types.power.PowerDistributor;
|
||||
import io.anuke.mindustry.world.blocks.types.production.Smelter;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public enum Difficulty {
|
||||
easy(4f, 2f, 1f, new DestrutiveHeuristic(b -> b instanceof PowerDistributor)),
|
||||
normal(2f, 1f, 1f, new DestrutiveHeuristic(b -> b instanceof Smelter || b instanceof PowerDistributor)),
|
||||
hard(1.5f, 0.5f, 0.75f, new DestrutiveHeuristic(b -> b instanceof Turret || b instanceof PowerDistributor || b instanceof Drill || b instanceof Smelter)),
|
||||
insane(0.5f, 0.25f, 0.5f, new DestrutiveHeuristic(b -> b instanceof PowerDistributor || b instanceof Drill || b instanceof Smelter || b instanceof Router)),
|
||||
purge(0.25f, 0.01f, 0.25f, new DestrutiveHeuristic(b -> b instanceof PowerDistributor || b instanceof Drill || b instanceof Router
|
||||
|| b instanceof Smelter || b instanceof Conveyor || b instanceof LiquidBlock || b instanceof PowerBlock));
|
||||
easy(4f, 2f, 1f),
|
||||
normal(2f, 1f, 1f),
|
||||
hard(1.5f, 0.5f, 0.75f),
|
||||
insane(0.5f, 0.25f, 0.5f),
|
||||
purge(0.25f, 0.01f, 0.25f);
|
||||
|
||||
/**The scaling of how many waves it takes for one more enemy of a type to appear.
|
||||
* For example: with enemeyScaling = 2 and the default scaling being 2, it would take 4 waves for
|
||||
@@ -29,13 +17,10 @@ public enum Difficulty {
|
||||
public final float timeScaling;
|
||||
/**Scaling of max time between waves. Default time is 4 minutes.*/
|
||||
public final float maxTimeScaling;
|
||||
/**Pathfdining heuristic for calculating tile costs.*/
|
||||
public final Heuristic<Tile> heuristic;
|
||||
|
||||
Difficulty(float enemyScaling, float timeScaling, float maxTimeScaling, Heuristic<Tile> heuristic){
|
||||
Difficulty(float enemyScaling, float timeScaling, float maxTimeScaling){
|
||||
this.enemyScaling = enemyScaling;
|
||||
this.timeScaling = timeScaling;
|
||||
this.heuristic = heuristic;
|
||||
this.maxTimeScaling = maxTimeScaling;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import com.badlogic.gdx.ai.pfa.PathFinder;
|
||||
import com.badlogic.gdx.ai.pfa.PathFinderRequest;
|
||||
|
||||
import io.anuke.mindustry.ai.SmoothGraphPath;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
|
||||
public class SpawnPoint{
|
||||
public Tile start;
|
||||
public Tile[] pathTiles;
|
||||
public PathFinder<Tile> finder;
|
||||
public SmoothGraphPath path = new SmoothGraphPath();
|
||||
public PathFinderRequest<Tile> request;
|
||||
|
||||
public SpawnPoint(Tile start){
|
||||
this.start = start;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user