Halved turret fire rate on Android to prevent lag

This commit is contained in:
Anuken
2017-07-02 22:57:41 -04:00
parent ec0aa2d2f3
commit 9c0b31e19a
3 changed files with 7 additions and 4 deletions

View File

@@ -13,7 +13,6 @@ import io.anuke.mindustry.input.GestureHandler;
import io.anuke.mindustry.input.Input; import io.anuke.mindustry.input.Input;
import io.anuke.mindustry.world.Generator; import io.anuke.mindustry.world.Generator;
import io.anuke.mindustry.world.blocks.ProductionBlocks; import io.anuke.mindustry.world.blocks.ProductionBlocks;
import io.anuke.ucore.UCore;
import io.anuke.ucore.core.*; import io.anuke.ucore.core.*;
import io.anuke.ucore.entities.Entities; import io.anuke.ucore.entities.Entities;
import io.anuke.ucore.graphics.Atlas; import io.anuke.ucore.graphics.Atlas;
@@ -152,7 +151,6 @@ public class Control extends RendererModule{
clampCamera(-tilesize / 2f, -tilesize / 2f, pixsize - tilesize / 2f, pixsize - tilesize / 2f); clampCamera(-tilesize / 2f, -tilesize / 2f, pixsize - tilesize / 2f, pixsize - tilesize / 2f);
if(android){ if(android){
UCore.log(camera.position.x-prevx, camera.position.y-prevy);
player.x += camera.position.x-prevx; player.x += camera.position.x-prevx;
player.y += camera.position.y-prevy; player.y += camera.position.y-prevy;
} }

View File

@@ -444,7 +444,7 @@ public class UI extends SceneModule{
Gdx.app.exit(); Gdx.app.exit();
}).width(w); }).width(w);
get().pad(20); get().pad(Unit.dp.inPixels(20));
}}; }};
get().setVisible(nplay); get().setVisible(nplay);

View File

@@ -90,6 +90,7 @@ public class Turret extends Block{
if(enemy != null){ if(enemy != null){
entity.rotation = MathUtils.lerpAngleDeg(entity.rotation, Angles.predictAngle(tile.worldx(), tile.worldy(), enemy.x, enemy.y, enemy.xvelocity, enemy.yvelocity, bullet.speed - 0.1f), 0.2f); entity.rotation = MathUtils.lerpAngleDeg(entity.rotation, Angles.predictAngle(tile.worldx(), tile.worldy(), enemy.x, enemy.y, enemy.xvelocity, enemy.yvelocity, bullet.speed - 0.1f), 0.2f);
float reload = Vars.android ? this.reload*2 : this.reload;
if(Timers.get(tile, reload)){ if(Timers.get(tile, reload)){
Effects.sound(shootsound, entity); Effects.sound(shootsound, entity);
shoot(tile); shoot(tile);
@@ -112,7 +113,11 @@ public class Turret extends Block{
} }
protected void bullet(Tile tile, float angle){ protected void bullet(Tile tile, float angle){
new Bullet(bullet, tile.entity, tile.worldx()+vector.x, tile.worldy()+vector.y, angle).add(); Bullet out = new Bullet(bullet, tile.entity, tile.worldx()+vector.x, tile.worldy()+vector.y, angle).add();
if(Vars.android){
out.damage *= 2;
}
} }
static class TurretEntity extends TileEntity{ static class TurretEntity extends TileEntity{