Actual updating and rendering
This commit is contained in:
@@ -6,7 +6,7 @@ import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@Component
|
||||
abstract class DrawShadowComp implements Drawc, Rotc, Flyingc, DrawLayerFlyingShadowsc, DrawLayerGroundShadowsc{
|
||||
abstract class DrawShadowComp implements Drawc, Rotc, Flyingc, DrawLayerFlyingShadowsc{
|
||||
static final float shadowTX = -12, shadowTY = -13, shadowColor = Color.toFloatBits(0, 0, 0, 0.22f);
|
||||
|
||||
transient float x, y, rotation;
|
||||
@@ -16,19 +16,6 @@ abstract class DrawShadowComp implements Drawc, Rotc, Flyingc, DrawLayerFlyingSh
|
||||
@Override
|
||||
public void drawFlyingShadows(){
|
||||
if(isFlying()){
|
||||
drawShadow();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGroundShadows(){
|
||||
if(isGrounded()){
|
||||
drawShadow();
|
||||
}
|
||||
}
|
||||
|
||||
void drawShadow(){
|
||||
if(!isGrounded()){
|
||||
Draw.color(shadowColor);
|
||||
Draw.rect(getShadowRegion(), x + shadowTX * elevation(), y + shadowTY * elevation(), rotation - 90);
|
||||
Draw.color();
|
||||
|
||||
@@ -2,6 +2,7 @@ package mindustry.entities.def;
|
||||
|
||||
import arc.func.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
import java.io.*;
|
||||
@@ -12,7 +13,7 @@ import static mindustry.Vars.player;
|
||||
@BaseComponent
|
||||
abstract class EntityComp{
|
||||
private boolean added;
|
||||
int id;
|
||||
int id = EntityGroup.nextId();
|
||||
|
||||
boolean isAdded(){
|
||||
return added;
|
||||
|
||||
@@ -19,6 +19,10 @@ abstract class PosComp implements Position{
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
void set(Position pos){
|
||||
set(pos.getX(), pos.getY());
|
||||
}
|
||||
|
||||
void trns(float x, float y){
|
||||
set(this.x + x, this.y + y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user