WIP crystal biome
This commit is contained in:
53
core/src/mindustry/world/blocks/environment/TallBlock.java
Normal file
53
core/src/mindustry/world/blocks/environment/TallBlock.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package mindustry.world.blocks.environment;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
//I don't know what else to call this. It's not a prop, it's not a tree.
|
||||
public class TallBlock extends Block{
|
||||
public float shadowOffset = -3f;
|
||||
public float layer = Layer.power + 1;
|
||||
public float rotationRand = 20f;
|
||||
|
||||
public TallBlock(String name){
|
||||
super(name);
|
||||
solid = true;
|
||||
clipSize = 90;
|
||||
customShadow = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
super.init();
|
||||
hasShadow = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBase(Tile tile){
|
||||
float rot = Mathf.randomSeedRange(tile.pos() + 1, rotationRand);
|
||||
|
||||
Draw.z(Layer.power - 1);
|
||||
Draw.color(0f, 0f, 0f, 0.6f);
|
||||
Draw.rect(variants > 0 ? variantShadowRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantShadowRegions.length - 1))] : customShadowRegion,
|
||||
tile.worldx() + shadowOffset, tile.worldy() + shadowOffset, rot);
|
||||
|
||||
Draw.color();
|
||||
|
||||
Draw.z(Layer.power + 1);
|
||||
Draw.rect(variants > 0 ? variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))] : region,
|
||||
tile.worldx(), tile.worldy(), rot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawShadow(Tile tile){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureRegion[] icons(){
|
||||
return variants == 0 ? super.icons() : new TextureRegion[]{Core.atlas.find(name + "1")};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user