Improved controls / Re-added engine sprite

This commit is contained in:
Anuken
2020-02-16 13:16:18 -05:00
parent e677538c53
commit 7a8bd82f8e
10 changed files with 93 additions and 38 deletions
@@ -56,8 +56,8 @@ public abstract class BulletType extends Content{
public boolean collidesTiles = true;
/** Whether this bullet type collides with tiles that are of the same team. */
public boolean collidesTeam = false;
/** Whether this bullet type collides with air units. */
public boolean collidesAir = true;
/** Whether this bullet type collides with air/ground units. */
public boolean collidesAir = true, collidesGround = true;
/** Whether this bullet types collides with anything at all. */
public boolean collides = true;
/** Whether velocity is inherited from the shooter. */
@@ -1,14 +1,12 @@
package mindustry.entities.bullet;
import arc.math.geom.Rect;
import arc.util.Time;
import mindustry.content.Fx;
import mindustry.entities.Units;
import arc.util.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
public class FlakBulletType extends BasicBulletType{
protected static Rect rect = new Rect();
protected float explodeRange = 30f;
public float explodeRange = 30f;
public FlakBulletType(float speed, float damage){
super(speed, damage, "shell");
@@ -17,6 +15,7 @@ public class FlakBulletType extends BasicBulletType{
hitEffect = Fx.flakExplosionBig;
bulletWidth = 8f;
bulletHeight = 10f;
collidesGround = false;
}
public FlakBulletType(){
@@ -29,8 +28,8 @@ public class FlakBulletType extends BasicBulletType{
if(b.data() instanceof Integer) return;
if(b.timer(2, 6)){
Units.nearbyEnemies(b.team(), rect.setSize(explodeRange * 2f).setCenter(b.x(), b.y()), unit -> {
if(b.data() instanceof Float) return;
Units.nearbyEnemies(b.team(), Tmp.r1.setSize(explodeRange * 2f).setCenter(b.x(), b.y()), unit -> {
if(b.data() instanceof Float || (unit.isFlying() && !collidesAir) || (unit.isGrounded() && !collidesGround)) return;
if(unit.dst(b) < explodeRange){
b.data(0);