diff --git a/.gitignore b/.gitignore index b77615b838..1ca9f7d39b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /desktop/packr-out/ /desktop/packr-export/ /core/lib/ +*.gif ## Java diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index d8df347bca..b87b9ed31f 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="10" + android:versionName="2.0" > diff --git a/build.gradle b/build.gradle index 356935d1f9..c07f35ac9b 100644 --- a/build.gradle +++ b/build.gradle @@ -79,7 +79,7 @@ project(":core") { apply plugin: "java" dependencies { - compile 'com.github.anuken:ucore:5633a3df2f' + compile 'com.github.anuken:ucore:2a0a7a54cc' compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-ai:1.8.1" } diff --git a/core/src/Mindustry.gwt.xml b/core/src/Mindustry.gwt.xml index ddf28a9d63..6ae741531e 100644 --- a/core/src/Mindustry.gwt.xml +++ b/core/src/Mindustry.gwt.xml @@ -2,5 +2,7 @@ - + + + \ No newline at end of file diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index d2a72c1738..e7aa78788d 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -3,6 +3,7 @@ package io.anuke.mindustry.entities; import static io.anuke.mindustry.Vars.*; import com.badlogic.gdx.Input.Buttons; +import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; @@ -51,7 +52,7 @@ public class Player extends DestructibleEntity{ float speed = this.speed; - if(Vars.debug) + if(Vars.debug && Inputs.keyDown(Keys.SHIFT_LEFT)) speed *= 3f; if(health < maxhealth && Timers.get(this, 50)) diff --git a/core/src/io/anuke/mindustry/entities/enemies/Enemy.java b/core/src/io/anuke/mindustry/entities/enemies/Enemy.java index 30b3044ebb..10cdf1d52e 100644 --- a/core/src/io/anuke/mindustry/entities/enemies/Enemy.java +++ b/core/src/io/anuke/mindustry/entities/enemies/Enemy.java @@ -108,10 +108,9 @@ public class Enemy extends DestructibleEntity{ int x2 = path[node].x, y2 = path[node].y; if(World.raycast(Mathf.scl2(x, Vars.tilesize), Mathf.scl2(y, Vars.tilesize), x2, y2) != null){ - Timers.run(Mathf.random(10f), ()->{ + Timers.run(Mathf.random(15f), ()->{ set(x2 * Vars.tilesize, y2 * Vars.tilesize); }); - } } @@ -173,7 +172,7 @@ public class Enemy extends DestructibleEntity{ String region = ClassReflection.getSimpleName(getClass()).toLowerCase() + "-t" + Mathf.clamp(tier, 1, 3); - //TODO is this necessary? + //TODO is this really necessary? Draw.getShader(Outline.class).color.set(tierColors[tier-1]); Draw.getShader(Outline.class).region = Draw.region(region); diff --git a/core/src/io/anuke/mindustry/world/World.java b/core/src/io/anuke/mindustry/world/World.java index f3e9d80acb..4a6c5bec7b 100644 --- a/core/src/io/anuke/mindustry/world/World.java +++ b/core/src/io/anuke/mindustry/world/World.java @@ -205,6 +205,8 @@ public class World{ Tile tile = tile(x, y); + if(tile == null) return false; + if(tile.block() != type && type.canReplace(tile.block())){ return true; } diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index 4665fde7f9..8339e8a50d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -68,6 +68,7 @@ public class ProductionBlocks{ dir = (dir+4)%4; Tile to = tile.getNearby()[dir]; Timers.run(10, ()->{ + if(to == null || to.entity == null) return; to.block().handleItem(to, item, tile); }); @@ -146,7 +147,7 @@ public class ProductionBlocks{ @Override public String description(){ - return "Takes in iron + water, outputs coal."; + return "Takes in iron + water, outputs titanium."; } }, diff --git a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java index d49786fe43..6d3e65cdf7 100644 --- a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java @@ -105,7 +105,6 @@ public class WeaponBlocks{ } }, - //TODO mortarturret = new Turret("mortarturret"){ { rotatespeed = 0.1f; @@ -116,10 +115,10 @@ public class WeaponBlocks{ ammo = Item.coal; ammoMultiplier = 5; health = 110; + overPrediction = 0.09f; } }, - //TODO laserturret = new LaserTurret("laserturret"){ @@ -135,7 +134,6 @@ public class WeaponBlocks{ } }, - //TODO teslaturret = new Turret("waveturret"){ { formalName = "tesla turret"; @@ -156,7 +154,6 @@ public class WeaponBlocks{ } }, - //TODO plasmaturret = new Turret("plasmaturret"){ { inaccuracy = 7f; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Turret.java b/core/src/io/anuke/mindustry/world/blocks/types/Turret.java index 20a9ace01f..18ce6414a9 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Turret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/Turret.java @@ -34,6 +34,7 @@ public class Turret extends Block{ protected int maxammo = 400; protected float rotatespeed = 0.2f; protected float shootCone = 8f; + protected float overPrediction = 0f; public Turret(String name) { super(name); @@ -108,7 +109,7 @@ public class Turret extends Block{ if(entity.target != null){ float targetRot = Angles.predictAngle(tile.worldx(), tile.worldy(), - entity.target.x, entity.target.y, entity.target.xvelocity, entity.target.yvelocity, bullet.speed); + entity.target.x, entity.target.y, entity.target.xvelocity, entity.target.yvelocity, bullet.speed + overPrediction); entity.rotation = MathUtils.lerpAngleDeg(entity.rotation, targetRot, rotatespeed*Timers.delta());