diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 8df6360324..2daa81be2c 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="15" + android:versionName="2.4" > diff --git a/build.gradle b/build.gradle index cdecd63644..353590e337 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ project(":html") { dependencies { compile project(":core") - //compile fileTree(dir: '../core/lib', include: '*.jar') + compile fileTree(dir: '../core/lib', include: '*.jar') compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion" compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources" compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources" diff --git a/core/src/io/anuke/mindustry/Control.java b/core/src/io/anuke/mindustry/Control.java index b4871710fc..d3eba4db6c 100644 --- a/core/src/io/anuke/mindustry/Control.java +++ b/core/src/io/anuke/mindustry/Control.java @@ -84,6 +84,7 @@ public class Control extends Module{ "down", Keys.S, "right", Keys.D, "rotate", Keys.R, + "rotate_back", Keys.E, "menu", Gdx.app.getType() == ApplicationType.Android ? Keys.BACK : Keys.ESCAPE, "pause", Keys.SPACE ); diff --git a/core/src/io/anuke/mindustry/Tutorial.java b/core/src/io/anuke/mindustry/Tutorial.java index c0c8662fe2..7a2710f2fa 100644 --- a/core/src/io/anuke/mindustry/Tutorial.java +++ b/core/src/io/anuke/mindustry/Tutorial.java @@ -182,7 +182,7 @@ public class Tutorial{ { canBack = false; canPlace = true; - text = "Try selecting a [yellow]conveyor[] from the block menu in the bottom left."; + text = "Try selecting a [yellow]conveyor[] from the block menu in the bottom right."; } void onSwitch(){ @@ -219,7 +219,7 @@ public class Tutorial{ { androidOnly = true; canBack = false; - text = "Alternatively, you can press the crosshair icon to switch to [orange][[touch mode][], and " + text = "Alternatively, you can press the crosshair icon in the bottom left to switch to [orange][[touch mode][], and " + "place blocks by tapping on the screen. In touch mode, blocks can be rotated with the arrow at the bottom left. " + "Press [yellow]next[] to try it out."; } @@ -237,7 +237,7 @@ public class Tutorial{ blockPlaceX = 0; blockPlaceY = -2; targetBlock = ProductionBlocks.stonedrill; - text = "Now, select and place a [yellow]stone drill[] at the marked location."; + text = "Now, select and place a [yellow]stone drill[] at the marked location."; } void onSwitch(){ @@ -365,14 +365,14 @@ public class Tutorial{ pausingDesktop{ { desktopOnly = true; - text = "If you ever need to take a break, press the [orange]pause button[] in the top right or [orange]space[] " + text = "If you ever need to take a break, press the [orange]pause button[] in the top left or [orange]space[] " + "to pause the game. You can still select and place blocks while paused, but cannot move or shoot."; } }, pausingAndroid{ { androidOnly = true; - text = "If you ever need to take a break, press the [orange]pause button[] in the top right" + text = "If you ever need to take a break, press the [orange]pause button[] in the top left" + " to pause the game. You can still place select and place blocks while paused."; } }, diff --git a/core/src/io/anuke/mindustry/UI.java b/core/src/io/anuke/mindustry/UI.java index b5156bafa5..65541b1424 100644 --- a/core/src/io/anuke/mindustry/UI.java +++ b/core/src/io/anuke/mindustry/UI.java @@ -465,7 +465,7 @@ public class UI extends SceneModule{ if(android){ //placement table new table(){{ - visible(()->player.recipe != null); + visible(()->player.recipe != null && !GameState.is(State.menu)); abottom(); aleft(); diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index f3f4f953af..18e4018910 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -14,7 +14,7 @@ public class Vars{ //respawn time in frames public static final float respawnduration = 60*4; //time between waves in frames - public static final float wavespace = 35*60*(android ? 1 : 1); + public static final float wavespace = 40*60*(android ? 1 : 1); //waves can last no longer than 6 minutes, otherwise the next one spawns public static final float maxwavespace = 60*60*6; //how far away from spawn points the player can't place blocks diff --git a/core/src/io/anuke/mindustry/entities/effect/Shield.java b/core/src/io/anuke/mindustry/entities/effect/Shield.java new file mode 100644 index 0000000000..d888722e74 --- /dev/null +++ b/core/src/io/anuke/mindustry/entities/effect/Shield.java @@ -0,0 +1,18 @@ +package io.anuke.mindustry.entities.effect; + +import io.anuke.ucore.entities.Entity; + +public class Shield extends Entity{ + public boolean active; + //TODO + + @Override + public void added(){ + active = true; + } + + @Override + public void removed(){ + active = false; + } +} diff --git a/core/src/io/anuke/mindustry/input/Input.java b/core/src/io/anuke/mindustry/input/Input.java index 91b3ef231d..b687a09748 100644 --- a/core/src/io/anuke/mindustry/input/Input.java +++ b/core/src/io/anuke/mindustry/input/Input.java @@ -22,23 +22,18 @@ public class Input{ if(Inputs.scrolled()){ Vars.renderer.scaleCamera(Inputs.scroll()); - //TODO - /* - int index = currentWeapon(); - - index -= Inputs.scroll(); - player.weapon = control.getWeapons().get(Mathf.clamp(index, 0, control.getWeapons().size-1)); - - ui.updateWeapons(); - */ } if(Inputs.keyUp("rotate")) - player.rotation++; + player.rotation ++; + + if(Inputs.keyUp("rotate_back")) + player.rotation --; + if(player.rotation < 0) + player.rotation += 4; + player.rotation %= 4; - - //TODO restore cursor when requirements are back for(int i = 0; i < 9; i ++){ if(Inputs.keyUp(Keys.valueOf(""+(i+1))) && i < control.getWeapons().size){ diff --git a/core/src/io/anuke/mindustry/resource/Recipe.java b/core/src/io/anuke/mindustry/resource/Recipe.java index 7b81c9cb4e..339a8ec0c3 100644 --- a/core/src/io/anuke/mindustry/resource/Recipe.java +++ b/core/src/io/anuke/mindustry/resource/Recipe.java @@ -43,7 +43,7 @@ public enum Recipe{ crucible(production, ProductionBlocks.crucible, stack(Item.titanium, 40), stack(Item.steel, 40)), coalpurifier(production, ProductionBlocks.coalpurifier, stack(Item.steel, 10), stack(Item.iron, 10)), titaniumpurifier(production, ProductionBlocks.titaniumpurifier, stack(Item.steel, 30), stack(Item.iron, 30)), - omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 20), stack(Item.dirium, 20)), + omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 10), stack(Item.dirium, 10)), conduit(distribution, ProductionBlocks.conduit, stack(Item.steel, 1)), liquidrouter(distribution, ProductionBlocks.liquidrouter, stack(Item.steel, 2)), diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index a14863f7c5..09dabe2088 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -28,6 +28,7 @@ public class Block{ //stuff that drops when broken public ItemStack drops = null; public Liquid liquidDrop = null; + public int width, height; public Block(String name) { blocks.add(this); diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index 7bc829f0cb..9664873434 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -178,7 +178,7 @@ public class ProductionBlocks{ omnidrill = new Drill("omnidrill"){ { - time = 3; + time = 2; formalName = "omnidrill"; } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Generator.java b/core/src/io/anuke/mindustry/world/blocks/types/Generator.java new file mode 100644 index 0000000000..6aa8d6cbf3 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/Generator.java @@ -0,0 +1,9 @@ +package io.anuke.mindustry.world.blocks.types; + +public class Generator extends PowerBlock{ + + public Generator(String name) { + super(name); + } + +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java new file mode 100644 index 0000000000..cd7f88b132 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java @@ -0,0 +1,15 @@ +package io.anuke.mindustry.world.blocks.types; + +import io.anuke.mindustry.world.Block; + +public abstract class PowerBlock extends Block{ + public float powerCapacity; + public float power; + + public PowerBlock(String name) { + super(name); + update = true; + solid = true; + } + +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/ShieldBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/ShieldBlock.java new file mode 100644 index 0000000000..dca672f5e3 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/ShieldBlock.java @@ -0,0 +1,45 @@ +package io.anuke.mindustry.world.blocks.types; + +import io.anuke.mindustry.entities.TileEntity; +import io.anuke.mindustry.entities.effect.Shield; +import io.anuke.mindustry.world.Tile; +import io.anuke.ucore.core.Timers; + +public class ShieldBlock extends PowerBlock{ + public float shieldRadius = 40f; + public float powerDrain = 0.01f; + + public ShieldBlock(String name) { + super(name); + } + + @Override + public void update(Tile tile){ + ShieldEntity entity = tile.entity(); + + if(entity.shield == null){ + entity.shield = new Shield(); + } + + if(power > powerDrain * Timers.delta()){ + if(!entity.shield.active){ + entity.shield.add(); + } + + power -= powerDrain * Timers.delta(); + }else{ + if(entity.shield.active){ + entity.shield.remove(); + } + } + } + + @Override + public TileEntity getEntity(){ + return new ShieldEntity(); + } + + static class ShieldEntity extends TileEntity{ + Shield shield; + } +}