Laid groundwork for tutorial, changed map storage
This commit is contained in:
@@ -7,6 +7,7 @@ import com.badlogic.gdx.Gdx;
|
|||||||
import com.badlogic.gdx.Input.Keys;
|
import com.badlogic.gdx.Input.Keys;
|
||||||
import com.badlogic.gdx.input.GestureDetector;
|
import com.badlogic.gdx.input.GestureDetector;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.ObjectMap;
|
||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||||
import com.badlogic.gdx.utils.reflect.Constructor;
|
import com.badlogic.gdx.utils.reflect.Constructor;
|
||||||
|
|
||||||
@@ -19,7 +20,10 @@ import io.anuke.mindustry.input.AndroidInput;
|
|||||||
import io.anuke.mindustry.input.GestureHandler;
|
import io.anuke.mindustry.input.GestureHandler;
|
||||||
import io.anuke.mindustry.input.Input;
|
import io.anuke.mindustry.input.Input;
|
||||||
import io.anuke.mindustry.io.SaveIO;
|
import io.anuke.mindustry.io.SaveIO;
|
||||||
|
import io.anuke.mindustry.resource.Item;
|
||||||
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.resource.Weapon;
|
import io.anuke.mindustry.resource.Weapon;
|
||||||
|
import io.anuke.mindustry.world.Map;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.World;
|
import io.anuke.mindustry.world.World;
|
||||||
import io.anuke.ucore.UCore;
|
import io.anuke.ucore.UCore;
|
||||||
@@ -34,9 +38,11 @@ public class Control extends Module{
|
|||||||
int targetscale = baseCameraScale;
|
int targetscale = baseCameraScale;
|
||||||
|
|
||||||
boolean showedTutorial;
|
boolean showedTutorial;
|
||||||
|
Tutorial tutorial = new Tutorial();
|
||||||
boolean hiscore = false;
|
boolean hiscore = false;
|
||||||
|
|
||||||
final Array<Weapon> weapons = new Array<>();
|
final Array<Weapon> weapons = new Array<>();
|
||||||
|
final ObjectMap<Item, Integer> items = new ObjectMap<>();
|
||||||
|
|
||||||
Array<EnemySpawn> spawns = new Array<>();
|
Array<EnemySpawn> spawns = new Array<>();
|
||||||
int wave = 1;
|
int wave = 1;
|
||||||
@@ -84,8 +90,8 @@ public class Control extends Module{
|
|||||||
|
|
||||||
Settings.loadAll("io.anuke.moment");
|
Settings.loadAll("io.anuke.moment");
|
||||||
|
|
||||||
for(String map : maps){
|
for(Map map : Map.values()){
|
||||||
Settings.defaults("hiscore"+map, 0);
|
Settings.defaults("hiscore" + map.name(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
player = new Player();
|
player = new Player();
|
||||||
@@ -127,13 +133,6 @@ public class Control extends Module{
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
//TODO remove this debugging
|
|
||||||
for(int i = 1; i < 60; i ++){
|
|
||||||
UCore.log("\n\n--WAVE " + i);
|
|
||||||
printEnemies(i);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +153,7 @@ public class Control extends Module{
|
|||||||
player.add();
|
player.add();
|
||||||
|
|
||||||
player.heal();
|
player.heal();
|
||||||
Inventory.clearItems();
|
clearItems();
|
||||||
World.spawnpoints.clear();
|
World.spawnpoints.clear();
|
||||||
respawntime = -1;
|
respawntime = -1;
|
||||||
hiscore = false;
|
hiscore = false;
|
||||||
@@ -183,6 +182,20 @@ public class Control extends Module{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void playMap(Map map){
|
||||||
|
Vars.ui.showLoading();
|
||||||
|
|
||||||
|
Timers.run(16, ()->{
|
||||||
|
Vars.control.reset();
|
||||||
|
World.loadMap(map);
|
||||||
|
Vars.control.play();
|
||||||
|
});
|
||||||
|
|
||||||
|
Timers.run(18, ()->{
|
||||||
|
Vars.ui.hideLoading();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasWeapon(Weapon weapon){
|
public boolean hasWeapon(Weapon weapon){
|
||||||
return weapons.contains(weapon, true);
|
return weapons.contains(weapon, true);
|
||||||
}
|
}
|
||||||
@@ -236,10 +249,10 @@ public class Control extends Module{
|
|||||||
|
|
||||||
wave ++;
|
wave ++;
|
||||||
|
|
||||||
int last = Settings.getInt("hiscore"+maps[World.getMap()]);
|
int last = Settings.getInt("hiscore" + World.getMap().name());
|
||||||
|
|
||||||
if(wave > last){
|
if(wave > last){
|
||||||
Settings.putInt("hiscore"+maps[World.getMap()], wave);
|
Settings.putInt("hiscore" + World.getMap().name(), wave);
|
||||||
Settings.save();
|
Settings.save();
|
||||||
hiscore = true;
|
hiscore = true;
|
||||||
}
|
}
|
||||||
@@ -312,6 +325,52 @@ public class Control extends Module{
|
|||||||
return wave;
|
return wave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearItems(){
|
||||||
|
items.clear();
|
||||||
|
|
||||||
|
items.put(Item.stone, 40);
|
||||||
|
|
||||||
|
if(debug){
|
||||||
|
for(Item item : Item.values())
|
||||||
|
items.put(item, 2000000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAmount(Item item){
|
||||||
|
return items.get(item, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addItem(Item item, int amount){
|
||||||
|
items.put(item, items.get(item, 0)+amount);
|
||||||
|
ui.updateItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasItems(ItemStack[] items){
|
||||||
|
for(ItemStack stack : items)
|
||||||
|
if(!hasItem(stack))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasItem(ItemStack req){
|
||||||
|
return items.get(req.item, 0) >= req.amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeItem(ItemStack req){
|
||||||
|
items.put(req.item, items.get(req.item, 0)-req.amount);
|
||||||
|
ui.updateItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeItems(ItemStack... reqs){
|
||||||
|
for(ItemStack req : reqs)
|
||||||
|
items.put(req.item, items.get(req.item, 0)-req.amount);
|
||||||
|
ui.updateItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObjectMap<Item, Integer> getItems(){
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
Musics.shuffleAll();
|
Musics.shuffleAll();
|
||||||
@@ -322,7 +381,7 @@ public class Control extends Module{
|
|||||||
return World.solid(x, y);
|
return World.solid(x, y);
|
||||||
});
|
});
|
||||||
|
|
||||||
EffectLoader.create();
|
EffectCreator.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -386,10 +445,14 @@ public class Control extends Module{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extrawavetime -= delta();
|
if(!tutorial.active()){
|
||||||
|
extrawavetime -= delta();
|
||||||
|
|
||||||
if(enemies <= 0){
|
if(enemies <= 0){
|
||||||
wavetime -= delta();
|
wavetime -= delta();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
tutorial.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(wavetime <= 0 || (debug && Inputs.keyUp(Keys.F)) || extrawavetime <= 0){
|
if(wavetime <= 0 || (debug && Inputs.keyUp(Keys.F)) || extrawavetime <= 0){
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ import io.anuke.ucore.core.Effects;
|
|||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
|
|
||||||
public class EffectLoader{
|
public class EffectCreator{
|
||||||
static Color lightRed = Hue.mix(Color.WHITE, Color.FIREBRICK, 0.1f);
|
static Color lightRed = Hue.mix(Color.WHITE, Color.FIREBRICK, 0.1f);
|
||||||
|
|
||||||
public static void create(){
|
public static void create(){
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
package io.anuke.mindustry;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.ObjectMap;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.resource.Item;
|
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
|
||||||
|
|
||||||
public class Inventory{
|
|
||||||
final static ObjectMap<Item, Integer> items = new ObjectMap<>();
|
|
||||||
|
|
||||||
public static void clearItems(){
|
|
||||||
items.clear();
|
|
||||||
//TODO make this not hardcoded
|
|
||||||
items.put(Item.stone, 40);
|
|
||||||
|
|
||||||
if(debug){
|
|
||||||
items.put(Item.stone, 2000000);
|
|
||||||
items.put(Item.iron, 2000000);
|
|
||||||
items.put(Item.steel, 2000000);
|
|
||||||
items.put(Item.coal, 2000000);
|
|
||||||
items.put(Item.titanium, 2000000);
|
|
||||||
items.put(Item.dirium, 2000000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Iterable<Item> getItemTypes(){
|
|
||||||
return items.keys();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getAmount(Item item){
|
|
||||||
return items.get(item, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addItem(Item item, int amount){
|
|
||||||
items.put(item, items.get(item, 0)+amount);
|
|
||||||
ui.updateItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean hasItems(ItemStack[] items){
|
|
||||||
for(ItemStack stack : items)
|
|
||||||
if(!hasItem(stack))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean hasItem(ItemStack req){
|
|
||||||
return items.get(req.item, 0) >= req.amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void removeItem(ItemStack req){
|
|
||||||
items.put(req.item, items.get(req.item, 0)-req.amount);
|
|
||||||
ui.updateItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void removeItems(ItemStack... reqs){
|
|
||||||
for(ItemStack req : reqs)
|
|
||||||
items.put(req.item, items.get(req.item, 0)-req.amount);
|
|
||||||
ui.updateItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ObjectMap<Item, Integer> getItems(){
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -226,7 +226,7 @@ public class Renderer extends RendererModule{
|
|||||||
|
|
||||||
void renderPixelOverlay(){
|
void renderPixelOverlay(){
|
||||||
|
|
||||||
if(player.recipe != null && Inventory.hasItems(player.recipe.requirements) && (!ui.hasMouse() || android) && AndroidInput.mode == PlaceMode.cursor){
|
if(player.recipe != null && Vars.control.hasItems(player.recipe.requirements) && (!ui.hasMouse() || android) && AndroidInput.mode == PlaceMode.cursor){
|
||||||
float x = 0;
|
float x = 0;
|
||||||
float y = 0;
|
float y = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import io.anuke.mindustry.input.AndroidInput;
|
|||||||
import io.anuke.mindustry.input.PlaceMode;
|
import io.anuke.mindustry.input.PlaceMode;
|
||||||
import io.anuke.mindustry.resource.*;
|
import io.anuke.mindustry.resource.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
|
import io.anuke.mindustry.world.Map;
|
||||||
import io.anuke.ucore.core.*;
|
import io.anuke.ucore.core.*;
|
||||||
import io.anuke.ucore.function.VisibilityProvider;
|
import io.anuke.ucore.function.VisibilityProvider;
|
||||||
import io.anuke.ucore.modules.SceneModule;
|
import io.anuke.ucore.modules.SceneModule;
|
||||||
@@ -258,7 +259,7 @@ public class UI extends SceneModule{
|
|||||||
|
|
||||||
image.update(()->{
|
image.update(()->{
|
||||||
|
|
||||||
boolean has = Inventory.hasItems(r.requirements);
|
boolean has = control.hasItems(r.requirements);
|
||||||
//image.setDisabled(!has);
|
//image.setDisabled(!has);
|
||||||
image.setChecked(player.recipe == r);
|
image.setChecked(player.recipe == r);
|
||||||
//image.setTouchable(has ? Touchable.enabled : Touchable.disabled);
|
//image.setTouchable(has ? Touchable.enabled : Touchable.disabled);
|
||||||
@@ -292,14 +293,7 @@ public class UI extends SceneModule{
|
|||||||
|
|
||||||
end();
|
end();
|
||||||
}}.right().bottom().uniformX();
|
}}.right().bottom().uniformX();
|
||||||
/*
|
|
||||||
row();
|
|
||||||
|
|
||||||
if(!android){
|
|
||||||
new button("Upgrades", ()->{
|
|
||||||
upgrades.show();
|
|
||||||
}).uniformX().fillX();
|
|
||||||
}*/
|
|
||||||
visible(play);
|
visible(play);
|
||||||
|
|
||||||
}}.end();
|
}}.end();
|
||||||
@@ -367,7 +361,8 @@ public class UI extends SceneModule{
|
|||||||
row();
|
row();
|
||||||
|
|
||||||
new label(()-> control.getEnemiesRemaining() > 0 ?
|
new label(()-> control.getEnemiesRemaining() > 0 ?
|
||||||
control.getEnemiesRemaining() + " Enemies remaining" : "New wave in " + (int) (control.getWaveCountdown() / 60f))
|
control.getEnemiesRemaining() + " Enemies remaining" :
|
||||||
|
control.tutorial.active() ? "waiting..." : "New wave in " + (int) (control.getWaveCountdown() / 60f))
|
||||||
.minWidth(150);
|
.minWidth(150);
|
||||||
|
|
||||||
get().pad(Unit.dp.inPixels(12));
|
get().pad(Unit.dp.inPixels(12));
|
||||||
@@ -375,6 +370,12 @@ public class UI extends SceneModule{
|
|||||||
|
|
||||||
get().setVisible(play);
|
get().setVisible(play);
|
||||||
}}.end();
|
}}.end();
|
||||||
|
|
||||||
|
new table(){{
|
||||||
|
control.tutorial.buildUI(this);
|
||||||
|
|
||||||
|
visible(()->control.tutorial.active());
|
||||||
|
}}.end();
|
||||||
|
|
||||||
//menu table
|
//menu table
|
||||||
new table(){{
|
new table(){{
|
||||||
@@ -386,8 +387,11 @@ public class UI extends SceneModule{
|
|||||||
levels.show();
|
levels.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
row();
|
||||||
|
|
||||||
new button("Tutorial", ()->{
|
new button("Tutorial", ()->{
|
||||||
//TODO
|
//TODO show loading, etc
|
||||||
|
control.playMap(Map.tutorial);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(Gdx.app.getType() != ApplicationType.WebGL){
|
if(Gdx.app.getType() != ApplicationType.WebGL){
|
||||||
@@ -533,7 +537,7 @@ public class UI extends SceneModule{
|
|||||||
scene.add(tools);
|
scene.add(tools);
|
||||||
|
|
||||||
tools.setVisible(()->
|
tools.setVisible(()->
|
||||||
!GameState.is(State.menu) && android && player.recipe != null && Inventory.hasItems(player.recipe.requirements) &&
|
!GameState.is(State.menu) && android && player.recipe != null && control.hasItems(player.recipe.requirements) &&
|
||||||
AndroidInput.mode == PlaceMode.cursor
|
AndroidInput.mode == PlaceMode.cursor
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -583,7 +587,7 @@ public class UI extends SceneModule{
|
|||||||
Label reqlabel = new Label("");
|
Label reqlabel = new Label("");
|
||||||
|
|
||||||
reqlabel.update(()->{
|
reqlabel.update(()->{
|
||||||
int current = Inventory.getAmount(fs.item);
|
int current = control.getAmount(fs.item);
|
||||||
String text = Mathf.clamp(current, 0, stack.amount) + "/" + stack.amount;
|
String text = Mathf.clamp(current, 0, stack.amount) + "/" + stack.amount;
|
||||||
|
|
||||||
reqlabel.setColor(current < stack.amount ? Colors.get("missingitems") : Color.WHITE);
|
reqlabel.setColor(current < stack.amount ? Colors.get("missingitems") : Color.WHITE);
|
||||||
@@ -712,9 +716,9 @@ public class UI extends SceneModule{
|
|||||||
itemtable.clear();
|
itemtable.clear();
|
||||||
itemtable.left();
|
itemtable.left();
|
||||||
|
|
||||||
for(Item stack : Inventory.getItemTypes()){
|
for(Item stack : control.getItems().keys()){
|
||||||
Image image = new Image(Draw.region("icon-" + stack.name()));
|
Image image = new Image(Draw.region("icon-" + stack.name()));
|
||||||
Label label = new Label("" + Mindustry.formatter.format(Inventory.getAmount(stack)));
|
Label label = new Label("" + Mindustry.formatter.format(control.getAmount(stack)));
|
||||||
label.setFontScale(fontscale*1.5f);
|
label.setFontScale(fontscale*1.5f);
|
||||||
itemtable.add(image).size(8*3).units(Unit.dp);
|
itemtable.add(image).size(8*3).units(Unit.dp);
|
||||||
itemtable.add(label).left();
|
itemtable.add(label).left();
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class Vars{
|
|||||||
//if true, player speed will be increased, massive amounts of resources will be given on start, and other debug options will be available
|
//if true, player speed will be increased, massive amounts of resources will be given on start, and other debug options will be available
|
||||||
public static boolean debug = false;
|
public static boolean debug = false;
|
||||||
//number of save slots-- increasing may lead to layout issues
|
//number of save slots-- increasing may lead to layout issues
|
||||||
|
//TODO named save slots, possibly with a scroll dialog
|
||||||
public static final int saveSlots = 4;
|
public static final int saveSlots = 4;
|
||||||
|
|
||||||
//turret and enemy shoot speed inverse multiplier
|
//turret and enemy shoot speed inverse multiplier
|
||||||
@@ -41,8 +42,6 @@ public class Vars{
|
|||||||
|
|
||||||
public static Player player;
|
public static Player player;
|
||||||
|
|
||||||
public static final String[] maps = {"delta", "canyon", "pit", "maze"};
|
|
||||||
|
|
||||||
public static String[] aboutText = {
|
public static String[] aboutText = {
|
||||||
"Made by [ROYAL]Anuken[] for the" + "\nGDL Metal Monstrosity jam.",
|
"Made by [ROYAL]Anuken[] for the" + "\nGDL Metal Monstrosity jam.",
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import com.badlogic.gdx.Input.Keys;
|
|||||||
import com.badlogic.gdx.InputAdapter;
|
import com.badlogic.gdx.InputAdapter;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
|
||||||
import io.anuke.mindustry.Inventory;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.World;
|
import io.anuke.mindustry.world.World;
|
||||||
@@ -62,7 +62,7 @@ public class AndroidInput extends InputAdapter{
|
|||||||
if(player.breaktime >= tile.block().breaktime){
|
if(player.breaktime >= tile.block().breaktime){
|
||||||
brokeBlock = true;
|
brokeBlock = true;
|
||||||
if(tile.block().drops != null){
|
if(tile.block().drops != null){
|
||||||
Inventory.addItem(tile.block().drops.item, tile.block().drops.amount);
|
Vars.control.addItem(tile.block().drops.item, tile.block().drops.amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
Effects.effect("break", tile.worldx(), tile.worldy());
|
Effects.effect("break", tile.worldx(), tile.worldy());
|
||||||
@@ -95,7 +95,7 @@ public class AndroidInput extends InputAdapter{
|
|||||||
Sounds.play("place");
|
Sounds.play("place");
|
||||||
|
|
||||||
for(ItemStack stack : player.recipe.requirements){
|
for(ItemStack stack : player.recipe.requirements){
|
||||||
Inventory.removeItem(stack);
|
Vars.control.removeItem(stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.badlogic.gdx.Gdx;
|
|||||||
import com.badlogic.gdx.input.GestureDetector.GestureAdapter;
|
import com.badlogic.gdx.input.GestureDetector.GestureAdapter;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
|
||||||
import io.anuke.mindustry.Inventory;
|
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
@@ -35,7 +34,7 @@ public class GestureHandler extends GestureAdapter{
|
|||||||
@Override
|
@Override
|
||||||
public boolean tap (float x, float y, int count, int button) {
|
public boolean tap (float x, float y, int count, int button) {
|
||||||
if(AndroidInput.mode == PlaceMode.touch && !ui.hasMouse() && player.recipe != null &&
|
if(AndroidInput.mode == PlaceMode.touch && !ui.hasMouse() && player.recipe != null &&
|
||||||
Inventory.hasItems(player.recipe.requirements) && !Vars.ui.hasMouse() && !AndroidInput.brokeBlock){
|
Vars.control.hasItems(player.recipe.requirements) && !Vars.ui.hasMouse() && !AndroidInput.brokeBlock){
|
||||||
AndroidInput.mousex = x;
|
AndroidInput.mousex = x;
|
||||||
AndroidInput.mousey = y;
|
AndroidInput.mousey = y;
|
||||||
AndroidInput.place();
|
AndroidInput.place();
|
||||||
@@ -46,7 +45,7 @@ public class GestureHandler extends GestureAdapter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean pan(float x, float y, float deltaX, float deltaY){
|
public boolean pan(float x, float y, float deltaX, float deltaY){
|
||||||
if(player.recipe == null || !Inventory.hasItems(player.recipe.requirements) || AndroidInput.mode == PlaceMode.touch){
|
if(player.recipe == null || !Vars.control.hasItems(player.recipe.requirements) || AndroidInput.mode == PlaceMode.touch){
|
||||||
player.x -= deltaX*Core.camera.zoom/Core.cameraScale;
|
player.x -= deltaX*Core.camera.zoom/Core.cameraScale;
|
||||||
player.y += deltaY*Core.camera.zoom/Core.cameraScale;
|
player.y += deltaY*Core.camera.zoom/Core.cameraScale;
|
||||||
}else if(AndroidInput.mode == PlaceMode.cursor){
|
}else if(AndroidInput.mode == PlaceMode.cursor){
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import static io.anuke.mindustry.Vars.*;
|
|||||||
import com.badlogic.gdx.Input.Buttons;
|
import com.badlogic.gdx.Input.Buttons;
|
||||||
import com.badlogic.gdx.Input.Keys;
|
import com.badlogic.gdx.Input.Keys;
|
||||||
|
|
||||||
import io.anuke.mindustry.Inventory;
|
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.resource.Weapon;
|
import io.anuke.mindustry.resource.Weapon;
|
||||||
@@ -51,7 +50,7 @@ public class Input{
|
|||||||
|
|
||||||
if(Inputs.buttonUp(Buttons.LEFT) && player.recipe != null &&
|
if(Inputs.buttonUp(Buttons.LEFT) && player.recipe != null &&
|
||||||
World.validPlace(World.tilex(), World.tiley(), player.recipe.result) && !ui.hasMouse() &&
|
World.validPlace(World.tilex(), World.tiley(), player.recipe.result) && !ui.hasMouse() &&
|
||||||
Inventory.hasItems(player.recipe.requirements)){
|
Vars.control.hasItems(player.recipe.requirements)){
|
||||||
Tile tile = World.tile(World.tilex(), World.tiley());
|
Tile tile = World.tile(World.tilex(), World.tiley());
|
||||||
|
|
||||||
if(tile == null)
|
if(tile == null)
|
||||||
@@ -65,10 +64,10 @@ public class Input{
|
|||||||
Sounds.play("place");
|
Sounds.play("place");
|
||||||
|
|
||||||
for(ItemStack stack : player.recipe.requirements){
|
for(ItemStack stack : player.recipe.requirements){
|
||||||
Inventory.removeItem(stack);
|
Vars.control.removeItem(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Inventory.hasItems(player.recipe.requirements)){
|
if(!Vars.control.hasItems(player.recipe.requirements)){
|
||||||
Cursors.restoreCursor();
|
Cursors.restoreCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,7 +86,7 @@ public class Input{
|
|||||||
player.breaktime += Timers.delta();
|
player.breaktime += Timers.delta();
|
||||||
if(player.breaktime >= tile.block().breaktime){
|
if(player.breaktime >= tile.block().breaktime){
|
||||||
if(tile.block().drops != null){
|
if(tile.block().drops != null){
|
||||||
Inventory.addItem(tile.block().drops.item, tile.block().drops.amount);
|
Vars.control.addItem(tile.block().drops.item, tile.block().drops.amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
Effects.effect("break", tile.worldx(), tile.worldy());
|
Effects.effect("break", tile.worldx(), tile.worldy());
|
||||||
|
|||||||
@@ -14,15 +14,12 @@ import com.badlogic.gdx.utils.ObjectMap;
|
|||||||
import com.badlogic.gdx.utils.TimeUtils;
|
import com.badlogic.gdx.utils.TimeUtils;
|
||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||||
|
|
||||||
import io.anuke.mindustry.Inventory;
|
|
||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.entities.enemies.*;
|
import io.anuke.mindustry.entities.enemies.*;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.resource.Weapon;
|
import io.anuke.mindustry.resource.Weapon;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.World;
|
|
||||||
import io.anuke.mindustry.world.blocks.Blocks;
|
import io.anuke.mindustry.world.blocks.Blocks;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
@@ -171,11 +168,11 @@ public class SaveIO{
|
|||||||
|
|
||||||
//--INVENTORY--
|
//--INVENTORY--
|
||||||
|
|
||||||
stream.writeByte(Inventory.getItems().size); //amount of items
|
stream.writeByte(Vars.control.getItems().size); //amount of items
|
||||||
|
|
||||||
for(Item item : Inventory.getItems().keys()){
|
for(Item item : Vars.control.getItems().keys()){
|
||||||
stream.writeByte(item.ordinal()); //item ID
|
stream.writeByte(item.ordinal()); //item ID
|
||||||
stream.writeInt(Inventory.getAmount(item)); //item amount
|
stream.writeInt(Vars.control.getAmount(item)); //item amount
|
||||||
}
|
}
|
||||||
|
|
||||||
//--ENEMIES--
|
//--ENEMIES--
|
||||||
@@ -205,7 +202,7 @@ public class SaveIO{
|
|||||||
//--MAP DATA--
|
//--MAP DATA--
|
||||||
|
|
||||||
//map ID
|
//map ID
|
||||||
stream.writeByte(World.getMap());
|
stream.writeByte(World.getMap().ordinal());
|
||||||
|
|
||||||
//seed
|
//seed
|
||||||
stream.writeInt(World.getSeed());
|
stream.writeInt(World.getSeed());
|
||||||
@@ -300,12 +297,12 @@ public class SaveIO{
|
|||||||
|
|
||||||
int totalItems = stream.readByte();
|
int totalItems = stream.readByte();
|
||||||
|
|
||||||
Inventory.getItems().clear();
|
Vars.control.getItems().clear();
|
||||||
|
|
||||||
for(int i = 0; i < totalItems; i ++){
|
for(int i = 0; i < totalItems; i ++){
|
||||||
Item item = itemEnums[stream.readByte()];
|
Item item = itemEnums[stream.readByte()];
|
||||||
int amount = stream.readInt();
|
int amount = stream.readInt();
|
||||||
Inventory.getItems().put(item, amount);
|
Vars.control.getItems().put(item, amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vars.ui.updateItems();
|
Vars.ui.updateItems();
|
||||||
@@ -350,7 +347,7 @@ public class SaveIO{
|
|||||||
int seed = stream.readInt();
|
int seed = stream.readInt();
|
||||||
int tiles = stream.readInt();
|
int tiles = stream.readInt();
|
||||||
|
|
||||||
World.loadMap(mapid, seed);
|
World.loadMap(Map.values()[mapid], seed);
|
||||||
Vars.renderer.clearTiles();
|
Vars.renderer.clearTiles();
|
||||||
|
|
||||||
for(Enemy enemy : enemiesToUpdate){
|
for(Enemy enemy : enemiesToUpdate){
|
||||||
|
|||||||
@@ -1,60 +1,48 @@
|
|||||||
package io.anuke.mindustry.ui;
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.maps;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
|
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
|
import io.anuke.mindustry.world.Map;
|
||||||
import io.anuke.mindustry.world.World;
|
import io.anuke.mindustry.world.World;
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.scene.ui.ButtonGroup;
|
||||||
import io.anuke.ucore.scene.ui.*;
|
import io.anuke.ucore.scene.ui.Dialog;
|
||||||
|
import io.anuke.ucore.scene.ui.ImageButton;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
public class LevelDialog extends Dialog{
|
public class LevelDialog extends Dialog{
|
||||||
Label[] scores = new Label[maps.length];
|
private Map selectedMap = Map.delta;
|
||||||
private int selectedMap;
|
|
||||||
|
|
||||||
public LevelDialog(){
|
public LevelDialog(){
|
||||||
super("Level Select");
|
super("Level Select");
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
shown(()->{
|
|
||||||
for(int i = 0; i < maps.length; i ++)
|
|
||||||
scores[i].setText("High Score: [lime]" + Settings.getInt("hiscore"+maps[i]));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
getButtonTable().addButton("Play", ()->{
|
getButtonTable().addButton("Play", ()->{
|
||||||
hide();
|
hide();
|
||||||
Vars.ui.showLoading();
|
Vars.control.playMap(selectedMap);
|
||||||
Timers.run(16, ()->{
|
|
||||||
Vars.control.reset();
|
|
||||||
World.loadMap(selectedMap);
|
|
||||||
Vars.control.play();
|
|
||||||
});
|
|
||||||
|
|
||||||
Timers.run(18, ()->{
|
|
||||||
Vars.ui.hideLoading();
|
|
||||||
});
|
|
||||||
}).pad(3).size(180, 44).units(Unit.dp);
|
}).pad(3).size(180, 44).units(Unit.dp);
|
||||||
|
|
||||||
ButtonGroup<ImageButton> mapgroup = new ButtonGroup<>();
|
ButtonGroup<ImageButton> mapgroup = new ButtonGroup<>();
|
||||||
|
|
||||||
for(int i = 0; i < maps.length; i ++){
|
for(Map map : Map.values()){
|
||||||
content().add(maps[i]);
|
if(!map.visible) continue;
|
||||||
|
|
||||||
|
content().add(map.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
|
|
||||||
for(int i = 0; i < maps.length; i ++){
|
for(Map map : Map.values()){
|
||||||
int index = i;
|
if(!map.visible) continue;
|
||||||
ImageButton image = new ImageButton(new TextureRegion(World.getTexture(i)), "togglemap");
|
|
||||||
|
ImageButton image = new ImageButton(new TextureRegion(World.getTexture(map)), "togglemap");
|
||||||
mapgroup.add(image);
|
mapgroup.add(image);
|
||||||
image.clicked(()->{
|
image.clicked(()->{
|
||||||
selectedMap = index;
|
selectedMap = map;
|
||||||
});
|
});
|
||||||
image.getImageCell().size(Unit.dp.inPixels(164));
|
image.getImageCell().size(Unit.dp.inPixels(164));
|
||||||
content().add(image).size(Unit.dp.inPixels(180));
|
content().add(image).size(Unit.dp.inPixels(180));
|
||||||
@@ -62,9 +50,10 @@ public class LevelDialog extends Dialog{
|
|||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
|
|
||||||
for(int i = 0; i < maps.length; i ++){
|
for(Map map : Map.values()){
|
||||||
scores[i] = new Label("");
|
if(!map.visible) continue;
|
||||||
content().add(scores[i]);
|
|
||||||
|
content().add(()->"High Score: [lime]" + Settings.getInt("hiscore" + map.name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import io.anuke.ucore.scene.ui.Label;
|
|||||||
import io.anuke.ucore.scene.ui.TextButton;
|
import io.anuke.ucore.scene.ui.TextButton;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
|
//TODO unified save/load dialogs
|
||||||
public class LoadDialog extends Dialog{
|
public class LoadDialog extends Dialog{
|
||||||
|
|
||||||
public LoadDialog() {
|
public LoadDialog() {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import io.anuke.ucore.scene.ui.*;
|
|||||||
import io.anuke.ucore.scene.ui.layout.Cell;
|
import io.anuke.ucore.scene.ui.layout.Cell;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
|
//TODO unified save/load dialogs
|
||||||
public class SaveDialog extends Dialog{
|
public class SaveDialog extends Dialog{
|
||||||
|
|
||||||
public SaveDialog() {
|
public SaveDialog() {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import com.badlogic.gdx.graphics.Color;
|
|||||||
|
|
||||||
import io.anuke.mindustry.GameState;
|
import io.anuke.mindustry.GameState;
|
||||||
import io.anuke.mindustry.GameState.State;
|
import io.anuke.mindustry.GameState.State;
|
||||||
import io.anuke.mindustry.Inventory;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.resource.Weapon;
|
import io.anuke.mindustry.resource.Weapon;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.core.Draw;
|
||||||
@@ -58,7 +58,7 @@ public class UpgradeDialog extends Dialog{
|
|||||||
if(control.hasWeapon(weapon)){
|
if(control.hasWeapon(weapon)){
|
||||||
button.setDisabled(true);
|
button.setDisabled(true);
|
||||||
button.setColor(Color.GRAY);
|
button.setColor(Color.GRAY);
|
||||||
}else if(!Inventory.hasItems(weapon.requirements)){
|
}else if(!Vars.control.hasItems(weapon.requirements)){
|
||||||
button.setDisabled(true);
|
button.setDisabled(true);
|
||||||
}else{
|
}else{
|
||||||
button.setDisabled(false);
|
button.setDisabled(false);
|
||||||
@@ -92,7 +92,7 @@ public class UpgradeDialog extends Dialog{
|
|||||||
ItemStack[] req = weapon.requirements;
|
ItemStack[] req = weapon.requirements;
|
||||||
for(ItemStack s : req){
|
for(ItemStack s : req){
|
||||||
|
|
||||||
int amount = Math.min(Inventory.getAmount(s.item), s.amount);
|
int amount = Math.min(Vars.control.getAmount(s.item), s.amount);
|
||||||
reqtable.addImage(Draw.region("icon-" + s.item.name())).padRight(3).size(8*2);
|
reqtable.addImage(Draw.region("icon-" + s.item.name())).padRight(3).size(8*2);
|
||||||
reqtable.add(
|
reqtable.add(
|
||||||
(amount >= s.amount ? "" : "[RED]")
|
(amount >= s.amount ? "" : "[RED]")
|
||||||
@@ -123,7 +123,7 @@ public class UpgradeDialog extends Dialog{
|
|||||||
button.clicked(()->{
|
button.clicked(()->{
|
||||||
if(button.isDisabled()) return;
|
if(button.isDisabled()) return;
|
||||||
|
|
||||||
Inventory.removeItems(weapon.requirements);
|
Vars.control.removeItems(weapon.requirements);
|
||||||
control.addWeapon(weapon);
|
control.addWeapon(weapon);
|
||||||
ui.updateWeapons();
|
ui.updateWeapons();
|
||||||
run.listen();
|
run.listen();
|
||||||
|
|||||||
@@ -29,11 +29,12 @@ public class World{
|
|||||||
|
|
||||||
private static Pixmap[] mapPixmaps;
|
private static Pixmap[] mapPixmaps;
|
||||||
private static Texture[] mapTextures;
|
private static Texture[] mapTextures;
|
||||||
private static int currentMap;
|
private static Map currentMap;
|
||||||
private static Tile[][] tiles = new Tile[worldsize][worldsize];
|
private static Tile[][] tiles = new Tile[worldsize][worldsize];
|
||||||
private static Tile[] temptiles = new Tile[4];
|
private static Tile[] temptiles = new Tile[4];
|
||||||
|
|
||||||
public static Tile core;
|
public static Tile core;
|
||||||
|
//TODO move this to control?
|
||||||
public static Array<Tile> spawnpoints = new Array<Tile>();
|
public static Array<Tile> spawnpoints = new Array<Tile>();
|
||||||
|
|
||||||
public static boolean solid(int x, int y){
|
public static boolean solid(int x, int y){
|
||||||
@@ -51,16 +52,16 @@ public class World{
|
|||||||
return !wallSolid(x, y-1) || !wallSolid(x, y+1) || !wallSolid(x-1, y) ||!wallSolid(x+1, y);
|
return !wallSolid(x, y-1) || !wallSolid(x, y+1) || !wallSolid(x-1, y) ||!wallSolid(x+1, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getMap(){
|
public static Map getMap(){
|
||||||
return currentMap;
|
return currentMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int width(){
|
public static int width(){
|
||||||
return mapPixmaps[currentMap].getWidth();
|
return mapPixmaps[currentMap.ordinal()].getWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int height(){
|
public static int height(){
|
||||||
return mapPixmaps[currentMap].getHeight();
|
return mapPixmaps[currentMap.ordinal()].getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Tile tile(int x, int y){
|
public static Tile tile(int x, int y){
|
||||||
@@ -80,11 +81,13 @@ public class World{
|
|||||||
return temptiles;
|
return temptiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Texture getTexture(int map){
|
public static Texture getTexture(Map map){
|
||||||
return mapTextures[map];
|
return mapTextures[map.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadMaps(){
|
public static void loadMaps(){
|
||||||
|
Map[] maps = Map.values();
|
||||||
|
|
||||||
mapPixmaps = new Pixmap[maps.length];
|
mapPixmaps = new Pixmap[maps.length];
|
||||||
mapTextures = new Texture[maps.length];
|
mapTextures = new Texture[maps.length];
|
||||||
|
|
||||||
@@ -115,18 +118,18 @@ public class World{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadMap(int id){
|
public static void loadMap(Map map){
|
||||||
loadMap(id, MathUtils.random(0, 99999));
|
loadMap(map, MathUtils.random(0, 99999));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadMap(int id, int seed){
|
public static void loadMap(Map map, int seed){
|
||||||
|
|
||||||
spawnpoints.clear();
|
spawnpoints.clear();
|
||||||
|
|
||||||
int size = mapPixmaps[id].getWidth();
|
int size = mapPixmaps[map.ordinal()].getWidth();
|
||||||
worldsize = size;
|
worldsize = size;
|
||||||
pixsize = worldsize*tilesize;
|
pixsize = worldsize*tilesize;
|
||||||
currentMap = id;
|
currentMap = map;
|
||||||
|
|
||||||
if(tiles != null){
|
if(tiles != null){
|
||||||
clearTileEntities();
|
clearTileEntities();
|
||||||
@@ -146,7 +149,7 @@ public class World{
|
|||||||
Entities.resizeTree(0, 0, pixsize, pixsize);
|
Entities.resizeTree(0, 0, pixsize, pixsize);
|
||||||
|
|
||||||
World.seed = seed;
|
World.seed = seed;
|
||||||
Generator.generate(mapPixmaps[id]);
|
Generator.generate(mapPixmaps[map.ordinal()]);
|
||||||
|
|
||||||
Pathfind.reset();
|
Pathfind.reset();
|
||||||
|
|
||||||
@@ -183,6 +186,7 @@ public class World{
|
|||||||
return seed;
|
return seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO move this to control?
|
||||||
public static boolean validPlace(int x, int y, Block type){
|
public static boolean validPlace(int x, int y, Block type){
|
||||||
|
|
||||||
if(!cursorNear() && !android)
|
if(!cursorNear() && !android)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package io.anuke.mindustry.world.blocks;
|
package io.anuke.mindustry.world.blocks;
|
||||||
|
|
||||||
import io.anuke.mindustry.Inventory;
|
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
@@ -22,7 +21,7 @@ public class ProductionBlocks{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleItem(Tile tile, Item item, Tile source){
|
public void handleItem(Tile tile, Item item, Tile source){
|
||||||
Inventory.addItem(item, 1);
|
Vars.control.addItem(item, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
|
|
||||||
public class Turret extends Block{
|
public class Turret extends Block{
|
||||||
public static final int targetInterval = 15;
|
public static final int targetInterval = 15;
|
||||||
|
private static boolean drawDebug = false;
|
||||||
|
|
||||||
protected float range = 50f;
|
protected float range = 50f;
|
||||||
protected float reload = 10f;
|
protected float reload = 10f;
|
||||||
@@ -51,7 +52,7 @@ public class Turret extends Block{
|
|||||||
TurretEntity entity = tile.entity();
|
TurretEntity entity = tile.entity();
|
||||||
Draw.rect(name(), tile.worldx(), tile.worldy(), entity.rotation - 90);
|
Draw.rect(name(), tile.worldx(), tile.worldy(), entity.rotation - 90);
|
||||||
|
|
||||||
if(Vars.debug){
|
if(Vars.debug && drawDebug){
|
||||||
drawTargeting(tile);
|
drawTargeting(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user