Optmizied drawing of map

This commit is contained in:
Anuken
2017-12-07 14:23:43 -05:00
parent d9ed5bfd98
commit 475efc38d2
14 changed files with 151 additions and 95 deletions

View File

@@ -14,7 +14,7 @@ import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class EMP extends TimedEntity{
static final int maxTargets = 10;
static final int maxTargets = 8;
static Array<Tile> array = new Array<>();
int radius = 4;
@@ -53,7 +53,7 @@ public class EMP extends TimedEntity{
if(tile != null && tile.block() instanceof PowerAcceptor){
PowerAcceptor p = (PowerAcceptor)tile.block();
p.setPower(tile, 0f);
tile.entity.damage(damage*2); //extra damage
tile.entity.damage((int)(damage*1.6f)); //extra damage
}
//entity may be null here, after the block is dead!

View File

@@ -1,9 +1,12 @@
package io.anuke.mindustry.entities.enemies;
import com.badlogic.gdx.math.Vector2;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.entities.Bullet;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.ucore.util.Tmp;
public class BlastEnemy extends Enemy{
@@ -21,12 +24,14 @@ public class BlastEnemy extends Enemy{
void move(){
super.move();
float range = 10f;
Vector2 offset = Tmp.v3.setZero();
if(target instanceof TileEntity){
TileEntity e = (TileEntity)target;
range = (e.tile.block().width * Vars.tilesize) /2f + 6f;
range = (e.tile.block().width * Vars.tilesize) /2f + 8f;
offset.set(e.tile.block().getPlaceOffset());
}
if(target != null && target.distanceTo(this) < range){
if(target != null && target.distanceTo(this.x - offset.x, this.y - offset.y) < range){
explode();
}
}

View File

@@ -7,7 +7,7 @@ public class EmpEnemy extends Enemy{
public EmpEnemy() {
speed = 0.3f;
reload = 60;
reload = 70;
maxhealth = 210;
range = 80f;
bullet = BulletType.emp;