New basic water sprite

This commit is contained in:
Anuken
2019-01-29 22:26:02 -05:00
parent 5af35b6771
commit dbf05a1419
22 changed files with 725 additions and 766 deletions

View File

@@ -107,7 +107,7 @@ public class Blocks implements ContentList{
}
deepwater = new Floor("deepwater"){{
liquidColor = Color.valueOf("546bb3");
liquidColor = Color.valueOf("4d5ca4");
speedMultiplier = 0.2f;
variants = 0;
liquidDrop = Liquids.water;
@@ -120,7 +120,7 @@ public class Blocks implements ContentList{
}};
water = new Floor("water"){{
liquidColor = Color.valueOf("546bb3");
liquidColor = Color.valueOf("596ab8");
speedMultiplier = 0.5f;
variants = 0;
status = StatusEffects.wet;
@@ -165,25 +165,25 @@ public class Blocks implements ContentList{
playerUnmineable = true;
}};
holostone = new Floor("holostone"){{
hasOres = true;
edgeStyle = "blocky";
}};
iceSnow = new Floor("ice-snow"){{
variants = 3;
}};
snow = new Floor("snow"){{
minimapColor = Color.valueOf("c2d1d2");
}};
ice = new Floor("ice"){{
dragMultiplier = 0.2f;
speedMultiplier = 0.4f;
minimapColor = Color.valueOf("b8eef8");
}};
holostone = new Floor("holostone"){{
hasOres = true;
edgeStyle = "blocky";
}};
snow = new Floor("snow"){{
minimapColor = Color.valueOf("c2d1d2");
}};
grass = new Floor("grass"){{
hasOres = true;
minimapColor = Color.valueOf("549d5b");
@@ -776,7 +776,7 @@ public class Blocks implements ContentList{
blastDrill = new Drill("blast-drill"){{
requirements(Category.production, ItemStack.with(Items.copper, 130, Items.silicon, 120, Items.titanium, 100, Items.thorium, 60));
drillTime = 120;
drillTime = 200;
size = 3;
drawRim = true;
hasPower = true;
@@ -792,7 +792,7 @@ public class Blocks implements ContentList{
plasmaDrill = new Drill("plasma-drill"){{
heatColor = Color.valueOf("ff461b");
drillTime = 100;
drillTime = 150;
size = 4;
hasLiquids = true;
hasPower = true;

View File

@@ -117,7 +117,7 @@ public class Fx implements ContentList{
});
unitLand = new GroundEffect(30, e -> {
Draw.color(Palette.lightishGray, e.color, e.rotation);
Draw.color(Tmp.c1.set(e.color).mul(1.1f));
Angles.randLenVectors(e.id, 6, 17f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.3f);
});
@@ -1067,7 +1067,7 @@ public class Fx implements ContentList{
Draw.reset();
});
ripple = new GroundEffect(false, 30, e -> {
Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f));
Draw.color(Tmp.c1.set(e.color).mul(1.2f));
Lines.stroke(e.fout() + 0.4f);
Lines.circle(e.x, e.y, 2f + e.fin() * 4f);
Draw.reset();

View File

@@ -10,7 +10,7 @@ public class Liquids implements ContentList{
@Override
public void load(){
water = new Liquid("water", Color.valueOf("486acd")){{
water = new Liquid("water", Color.valueOf("596ab8")){{
heatCapacity = 0.4f;
tier = 0;
effect = StatusEffects.wet;

View File

@@ -168,7 +168,7 @@ public class Zones implements ContentList{
}};
}};
ruinousShores = new Zone("ruinousShores", new MapGenerator("groundZero", 1)){{ //TODO implement
ruinousShores = new Zone("ruinousShores", new MapGenerator("ruinousShores")){{ //TODO implement
deployCost = ItemStack.with(Items.copper, 300);
startingItems = ItemStack.with(Items.copper, 200);
conditionWave = 15;

View File

@@ -516,7 +516,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
if(mech.shake > 1f){
Effects.shake(mech.shake, mech.shake, this);
}
Effects.effect(Fx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f);
Effects.effect(Fx.unitLand, tile.floor().liquidColor == null ? tile.floor().minimapColor : tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f);
}
mech.onLand(this);
achievedFlight = false;

View File

@@ -3,6 +3,13 @@ package io.anuke.mindustry.graphics;
//TODO implement effects again
public enum CacheLayer{
water{
public void begin(){
//Draw.shader(Shaders.water);
}
public void end(){
//Draw.shader();
}
},
lava{
},
@@ -11,8 +18,7 @@ public enum CacheLayer{
space{
},
normal,
walls{ //TODO implement walls
};
walls;
public void begin(){

View File

@@ -124,6 +124,8 @@ public class FloorRenderer{
int crangex = (int) (camera.width / (chunksize * tilesize)) + 1;
int crangey = (int) (camera.height / (chunksize * tilesize)) + 1;
SpriteBatch batch = Core.batch;
Core.batch = cbatch;
layer.begin();
for(int x = -crangex; x <= crangex; x++){
@@ -142,6 +144,7 @@ public class FloorRenderer{
}
layer.end();
Core.batch = batch;
}
private void cacheChunk(int cx, int cy){

View File

@@ -207,7 +207,7 @@ public class Shaders{
public static class SurfaceShader extends LoadShader{
public SurfaceShader(String frag){
super(frag, "default");
super(frag, "cache");
}
@Override
@@ -217,7 +217,7 @@ public class Shaders{
Core.camera.position.y - Core.camera.height / 2 );
setUniformf("screensize", Core.camera.width,
Core.camera.height );
setUniformf("time", Time.time());
setUniformf("u_time", Time.time());
}
}

View File

@@ -155,6 +155,7 @@ public class HudFragment extends Fragment{
});
parent.fill(t -> {
t.touchable(Touchable.disabled);
t.visible(() -> !state.is(State.menu));
t.table("flat", c -> c.add("$nearpoint")
.update(l -> l.setColor(Tmp.c1.set(Color.WHITE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 10f, 1f))))

View File

@@ -133,7 +133,7 @@ public class Floor extends Block{
}
protected boolean doEdge(Floor other){
return (other.id < id || edges == null) && other.edgeOnto(this);
return (other.id > id || edges == null) && other.edgeOnto(this);
}
protected boolean edgeOnto(Floor other){