1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-11-11 14:56:10 +03:00

Added sector-specific spawns

This commit is contained in:
Anuken 2018-07-19 09:58:19 -04:00
parent 4d88a8206a
commit 091f591ffb
2 changed files with 9 additions and 3 deletions

View File

@ -168,8 +168,10 @@ public class WaveSpawner{
groundSpawns.clear(); groundSpawns.clear();
quadrants = new Bits(quadWidth() * quadHeight()); quadrants = new Bits(quadWidth() * quadHeight());
if(groups == null){ if(world.getSector() == null){
groups = Waves.getSpawns(); groups = Waves.getSpawns();
}else{
groups = world.getSector().spawns;
} }
} }

View File

@ -1,7 +1,9 @@
package io.anuke.mindustry.maps; package io.anuke.mindustry.maps;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.game.Saves.SaveSlot; import io.anuke.mindustry.game.Saves.SaveSlot;
import io.anuke.mindustry.game.SpawnGroup;
import io.anuke.mindustry.maps.goals.Goal; import io.anuke.mindustry.maps.goals.Goal;
import io.anuke.mindustry.maps.goals.WaveGoal; import io.anuke.mindustry.maps.goals.WaveGoal;
import io.anuke.ucore.util.Bits; import io.anuke.ucore.util.Bits;
@ -15,12 +17,14 @@ public class Sector{
public boolean complete; public boolean complete;
/**Slot ID of this sector's save. -1 means no save has been created.*/ /**Slot ID of this sector's save. -1 means no save has been created.*/
public int saveID = -1; public int saveID = -1;
/**Sector size; if more than 1, the coordinates are the bottom left corner.*/
public int size = 1;
/**Display texture. Needs to be disposed.*/ /**Display texture. Needs to be disposed.*/
public transient Texture texture; public transient Texture texture;
/**Goal of this sector-- what needs to be accomplished to unlock it.*/ /**Goal of this sector-- what needs to be accomplished to unlock it.*/
public transient Goal goal = new WaveGoal(30); public transient Goal goal = new WaveGoal(30);
/**Sector size; if more than 1, the coordinates are the bottom left corner.*/ /**Enemies spawned at this sector.*/
public int size = 1; public transient Array<SpawnGroup> spawns = new Array<>();
public SaveSlot getSave(){ public SaveSlot getSave(){
return control.getSaves().getByID(saveID); return control.getSaves().getByID(saveID);