Inlined Time.time
This commit is contained in:
@@ -38,9 +38,9 @@ public class Puddles{
|
||||
|
||||
Puddle p = map.get(tile.pos());
|
||||
|
||||
if(generation == 0 && p != null && p.lastRipple() <= Time.time() - 40f){
|
||||
if(generation == 0 && p != null && p.lastRipple() <= Time.time - 40f){
|
||||
Fx.ripple.at((tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f, 1f, tile.floor().liquidDrop.color);
|
||||
p.lastRipple(Time.time());
|
||||
p.lastRipple(Time.time);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -62,9 +62,9 @@ public class Puddles{
|
||||
}else if(p.liquid() == liquid){
|
||||
p.accepting(Math.max(amount, p.accepting()));
|
||||
|
||||
if(generation == 0 && p.lastRipple() <= Time.time() - 40f && p.amount() >= maxLiquid / 2f){
|
||||
if(generation == 0 && p.lastRipple() <= Time.time - 40f && p.amount() >= maxLiquid / 2f){
|
||||
Fx.ripple.at((tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f, 1f, p.liquid().color);
|
||||
p.lastRipple(Time.time());
|
||||
p.lastRipple(Time.time);
|
||||
}
|
||||
}else{
|
||||
p.amount(p.amount() + reactPuddle(p.liquid(), liquid, amount, p.tile(), (p.x() + source.worldx())/2f, (p.y() + source.worldy())/2f));
|
||||
|
||||
@@ -85,10 +85,10 @@ public class ContinuousLaserBulletType extends BulletType{
|
||||
|
||||
Lines.lineAngle(b.x, b.y, b.rotation(), baseLen);
|
||||
for(int s = 0; s < colors.length; s++){
|
||||
Draw.color(Tmp.c1.set(colors[s]).mul(1f + Mathf.absin(Time.time(), 1f, 0.1f)));
|
||||
Draw.color(Tmp.c1.set(colors[s]).mul(1f + Mathf.absin(Time.time, 1f, 0.1f)));
|
||||
for(int i = 0; i < tscales.length; i++){
|
||||
Tmp.v1.trns(b.rotation() + 180f, (lenscales[i] - 1f) * spaceMag);
|
||||
Lines.stroke((width + Mathf.absin(Time.time(), oscScl, oscMag)) * fout * strokes[s] * tscales[i]);
|
||||
Lines.stroke((width + Mathf.absin(Time.time, oscScl, oscMag)) * fout * strokes[s] * tscales[i]);
|
||||
Lines.lineAngle(b.x + Tmp.v1.x, b.y + Tmp.v1.y, b.rotation(), baseLen * lenscales[i], false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{
|
||||
float tx = plan.drawx(), ty = plan.drawy();
|
||||
|
||||
Lines.stroke(1f, Pal.accent);
|
||||
float focusLen = 3.8f + Mathf.absin(Time.time(), 1.1f, 0.6f);
|
||||
float focusLen = 3.8f + Mathf.absin(Time.time, 1.1f, 0.6f);
|
||||
float px = x + Angles.trnsx(rotation, focusLen);
|
||||
float py = y + Angles.trnsy(rotation, focusLen);
|
||||
|
||||
@@ -246,7 +246,7 @@ abstract class BuilderComp implements Posc, Teamc, Rotc{
|
||||
Lines.line(px, py, x1, y1);
|
||||
Lines.line(px, py, x3, y3);
|
||||
|
||||
Fill.circle(px, py, 1.6f + Mathf.absin(Time.time(), 0.8f, 1.5f));
|
||||
Fill.circle(px, py, 1.6f + Mathf.absin(Time.time, 0.8f, 1.5f));
|
||||
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
||||
}
|
||||
|
||||
void wobble(){
|
||||
x += Mathf.sin(Time.time() + (id() % 10) * 12, 25f, 0.05f) * Time.delta * elevation;
|
||||
y += Mathf.cos(Time.time() + (id() % 10) * 12, 25f, 0.05f) * Time.delta * elevation;
|
||||
x += Mathf.sin(Time.time + (id() % 10) * 12, 25f, 0.05f) * Time.delta * elevation;
|
||||
y += Mathf.cos(Time.time + (id() % 10) * 12, 25f, 0.05f) * Time.delta * elevation;
|
||||
}
|
||||
|
||||
void moveAt(Vec2 vector, float acceleration){
|
||||
|
||||
@@ -105,25 +105,25 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
||||
@Override
|
||||
public void draw(){
|
||||
if(!mining()) return;
|
||||
float focusLen = hitSize / 2f + Mathf.absin(Time.time(), 1.1f, 0.5f);
|
||||
float focusLen = hitSize / 2f + Mathf.absin(Time.time, 1.1f, 0.5f);
|
||||
float swingScl = 12f, swingMag = tilesize / 8f;
|
||||
float flashScl = 0.3f;
|
||||
|
||||
float px = x + Angles.trnsx(rotation, focusLen);
|
||||
float py = y + Angles.trnsy(rotation, focusLen);
|
||||
|
||||
float ex = mineTile.worldx() + Mathf.sin(Time.time() + 48, swingScl, swingMag);
|
||||
float ey = mineTile.worldy() + Mathf.sin(Time.time() + 48, swingScl + 2f, swingMag);
|
||||
float ex = mineTile.worldx() + Mathf.sin(Time.time + 48, swingScl, swingMag);
|
||||
float ey = mineTile.worldy() + Mathf.sin(Time.time + 48, swingScl + 2f, swingMag);
|
||||
|
||||
Draw.z(Layer.flyingUnit + 0.1f);
|
||||
|
||||
Draw.color(Color.lightGray, Color.white, 1f - flashScl + Mathf.absin(Time.time(), 0.5f, flashScl));
|
||||
Draw.color(Color.lightGray, Color.white, 1f - flashScl + Mathf.absin(Time.time, 0.5f, flashScl));
|
||||
|
||||
Drawf.laser(team(), Core.atlas.find("minelaser"), Core.atlas.find("minelaser-end"), px, py, ex, ey, 0.75f);
|
||||
|
||||
if(isLocal()){
|
||||
Lines.stroke(1f, Pal.accent);
|
||||
Lines.poly(mineTile.worldx(), mineTile.worldy(), 4, tilesize / 2f * Mathf.sqrt2, Time.time());
|
||||
Lines.poly(mineTile.worldx(), mineTile.worldy(), 4, tilesize / 2f * Mathf.sqrt2, Time.time);
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
|
||||
@@ -243,7 +243,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
|
||||
}
|
||||
|
||||
if(Core.settings.getBool("playerchat") && ((textFadeTime > 0 && lastText != null) || typing)){
|
||||
String text = textFadeTime <= 0 || lastText == null ? "[lightgray]" + Strings.animated(Time.time(), 4, 15f, ".") : lastText;
|
||||
String text = textFadeTime <= 0 || lastText == null ? "[lightgray]" + Strings.animated(Time.time, 4, 15f, ".") : lastText;
|
||||
float width = 100f;
|
||||
float visualFadeTime = 1f - Mathf.curve(1f - textFadeTime, 0.9f);
|
||||
font.setColor(1f, 1f, 1f, textFadeTime <= 0 || lastText == null ? 1f : visualFadeTime);
|
||||
|
||||
@@ -101,10 +101,10 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
|
||||
float sscl = 25f;
|
||||
|
||||
Draw.color(tmp.set(liquid.color).shiftValue(-0.05f));
|
||||
Fill.circle(x + Mathf.sin(Time.time() + seeds * 532, sscl, smag), y + Mathf.sin(Time.time() + seeds * 53, sscl, smag), f * 8f);
|
||||
Fill.circle(x + Mathf.sin(Time.time + seeds * 532, sscl, smag), y + Mathf.sin(Time.time + seeds * 53, sscl, smag), f * 8f);
|
||||
Angles.randLenVectors(id(), 3, f * 6f, (ex, ey) -> {
|
||||
Fill.circle(x + ex + Mathf.sin(Time.time() + seeds * 532, sscl, smag),
|
||||
y + ey + Mathf.sin(Time.time() + seeds * 53, sscl, smag), f * 5f);
|
||||
Fill.circle(x + ex + Mathf.sin(Time.time + seeds * 532, sscl, smag),
|
||||
y + ey + Mathf.sin(Time.time + seeds * 53, sscl, smag), f * 5f);
|
||||
seeds++;
|
||||
});
|
||||
Draw.color();
|
||||
|
||||
@@ -201,7 +201,7 @@ public class Universe{
|
||||
}
|
||||
|
||||
sector.info.export.each((item, amount) -> {
|
||||
if(sector.info.items.get(item) <= 0 && sector.info.production.get(item, ExportStat::new).mean <= 0){
|
||||
if(sector.info.items.get(item) <= 0 && sector.info.production.get(item, ExportStat::new).mean < 0){
|
||||
//disable export when production is negative.
|
||||
sector.info.export.get(item).mean = 0f;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class BlockRenderer implements Disposable{
|
||||
if(!camera.bounds(Tmp.r1).grow(tilesize * 2f).overlaps(Tmp.r2.setSize(b.size * tilesize).setCenter(block.x * tilesize + b.offset, block.y * tilesize + b.offset))) continue;
|
||||
|
||||
Draw.alpha(0.33f * brokenFade);
|
||||
Draw.mixcol(Color.white, 0.2f + Mathf.absin(Time.globalTime(), 6f, 0.2f));
|
||||
Draw.mixcol(Color.white, 0.2f + Mathf.absin(Time.globalTime, 6f, 0.2f));
|
||||
Draw.rect(b.icon(Cicon.full), block.x * tilesize + b.offset, block.y * tilesize + b.offset, b.rotate ? block.rotation * 90 : 0f);
|
||||
}
|
||||
Draw.reset();
|
||||
|
||||
@@ -257,11 +257,11 @@ public class MenuRenderer implements Disposable{
|
||||
|
||||
Draw.color(Pal.engine);
|
||||
Fill.circle(x + Angles.trnsx(rotation + 180, engineOffset), y + Angles.trnsy(rotation + 180, engineOffset),
|
||||
engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f));
|
||||
engineSize + Mathf.absin(Time.time, 2f, engineSize / 4f));
|
||||
|
||||
Draw.color(Color.white);
|
||||
Fill.circle(x + Angles.trnsx(rotation + 180, engineOffset - 1f), y + Angles.trnsy(rotation + 180, engineOffset - 1f),
|
||||
(engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f)) / 2f);
|
||||
(engineSize + Mathf.absin(Time.time, 2f, engineSize / 4f)) / 2f);
|
||||
Draw.color();
|
||||
|
||||
Draw.rect(icon, x, y, flyerRot - 90);
|
||||
|
||||
@@ -89,7 +89,7 @@ public class OverlayRenderer{
|
||||
}
|
||||
|
||||
Lines.stroke(unitFade);
|
||||
Lines.square(select.x, select.y, select.hitSize() * 1.5f, Time.time() * 2f);
|
||||
Lines.square(select.x, select.y, select.hitSize() * 1.5f, Time.time * 2f);
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
@@ -112,14 +112,14 @@ public class OverlayRenderer{
|
||||
if(dst < state.rules.enemyCoreBuildRadius * 2.2f){
|
||||
Draw.color(Color.darkGray);
|
||||
Lines.circle(core.x, core.y - 2, state.rules.enemyCoreBuildRadius);
|
||||
Draw.color(Pal.accent, core.team.color, 0.5f + Mathf.absin(Time.time(), 10f, 0.5f));
|
||||
Draw.color(Pal.accent, core.team.color, 0.5f + Mathf.absin(Time.time, 10f, 0.5f));
|
||||
Lines.circle(core.x, core.y, state.rules.enemyCoreBuildRadius);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Lines.stroke(2f);
|
||||
Draw.color(Color.gray, Color.lightGray, Mathf.absin(Time.time(), 8f, 1f));
|
||||
Draw.color(Color.gray, Color.lightGray, Mathf.absin(Time.time, 8f, 1f));
|
||||
|
||||
if(state.hasSpawns()){
|
||||
for(Tile tile : spawner.getSpawns()){
|
||||
@@ -167,15 +167,15 @@ public class OverlayRenderer{
|
||||
float size = 8;
|
||||
Draw.rect(player.unit().item().icon(Cicon.medium), v.x, v.y, size, size);
|
||||
Draw.color(Pal.accent);
|
||||
Lines.circle(v.x, v.y, 6 + Mathf.absin(Time.time(), 5f, 1f));
|
||||
Lines.circle(v.x, v.y, 6 + Mathf.absin(Time.time, 5f, 1f));
|
||||
Draw.reset();
|
||||
|
||||
Building tile = world.buildWorld(v.x, v.y);
|
||||
if(input.canDropItem() && tile != null && tile.interactable(player.team()) && tile.acceptStack(player.unit().item(), player.unit().stack.amount, player.unit()) > 0 && player.within(tile, itemTransferRange)){
|
||||
Lines.stroke(3f, Pal.gray);
|
||||
Lines.square(tile.x, tile.y, tile.block.size * tilesize / 2f + 3 + Mathf.absin(Time.time(), 5f, 1f));
|
||||
Lines.square(tile.x, tile.y, tile.block.size * tilesize / 2f + 3 + Mathf.absin(Time.time, 5f, 1f));
|
||||
Lines.stroke(1f, Pal.place);
|
||||
Lines.square(tile.x, tile.y, tile.block.size * tilesize / 2f + 2 + Mathf.absin(Time.time(), 5f, 1f));
|
||||
Lines.square(tile.x, tile.y, tile.block.size * tilesize / 2f + 2 + Mathf.absin(Time.time, 5f, 1f));
|
||||
Draw.reset();
|
||||
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class Shaders{
|
||||
public void apply(){
|
||||
setUniformf("u_resolution", Core.graphics.getWidth(), Core.graphics.getHeight());
|
||||
|
||||
setUniformf("u_time", Time.globalTime() / 10f);
|
||||
setUniformf("u_time", Time.globalTime / 10f);
|
||||
setUniformf("u_campos", camera.position);
|
||||
setUniformf("u_rcampos", Tmp.v31.set(camera.position).sub(planet.position));
|
||||
setUniformf("u_light", planet.getLightNormal());
|
||||
@@ -174,7 +174,7 @@ public class Shaders{
|
||||
setUniformf("u_color", color);
|
||||
setUniformf("u_uv", region.u, region.v);
|
||||
setUniformf("u_uv2", region.u2, region.v2);
|
||||
setUniformf("u_time", Time.time());
|
||||
setUniformf("u_time", Time.time);
|
||||
setUniformf("u_texsize", region.texture.width, region.texture.height);
|
||||
}
|
||||
}
|
||||
@@ -188,7 +188,7 @@ public class Shaders{
|
||||
@Override
|
||||
public void apply(){
|
||||
setUniformf("u_dp", Scl.scl(1f));
|
||||
setUniformf("u_time", Time.time() / Scl.scl(1f));
|
||||
setUniformf("u_time", Time.time / Scl.scl(1f));
|
||||
setUniformf("u_offset",
|
||||
Core.camera.position.x - Core.camera.width / 2,
|
||||
Core.camera.position.y - Core.camera.height / 2);
|
||||
@@ -216,7 +216,7 @@ public class Shaders{
|
||||
setUniformf("u_campos", Core.camera.position.x, Core.camera.position.y);
|
||||
setUniformf("u_ccampos", Core.camera.position);
|
||||
setUniformf("u_resolution", Core.graphics.getWidth(), Core.graphics.getHeight());
|
||||
setUniformf("u_time", Time.time());
|
||||
setUniformf("u_time", Time.time);
|
||||
|
||||
texture.bind(1);
|
||||
renderer.effectBuffer.getTexture().bind(0);
|
||||
@@ -240,7 +240,7 @@ public class Shaders{
|
||||
public void apply(){
|
||||
setUniformf("u_campos", Core.camera.position.x - Core.camera.width / 2, Core.camera.position.y - Core.camera.height / 2);
|
||||
setUniformf("u_resolution", Core.camera.width, Core.camera.height);
|
||||
setUniformf("u_time", Time.time());
|
||||
setUniformf("u_time", Time.time);
|
||||
|
||||
if(hasUniform("u_noise")){
|
||||
Core.assets.get("sprites/noise.png", Texture.class).bind(1);
|
||||
|
||||
@@ -209,7 +209,7 @@ public class PlanetRenderer implements Disposable{
|
||||
|
||||
for(int i = 0; i < pointCount + 1; i++){
|
||||
float f = i / (float)pointCount;
|
||||
Tmp.c1.set(from).lerp(to, (f+Time.globalTime()/timeScale)%1f);
|
||||
Tmp.c1.set(from).lerp(to, (f+ Time.globalTime /timeScale)%1f);
|
||||
batch.color(Tmp.c1);
|
||||
batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f));
|
||||
|
||||
@@ -218,7 +218,7 @@ public class PlanetRenderer implements Disposable{
|
||||
}
|
||||
|
||||
public void drawBorders(Sector sector, Color base){
|
||||
Color color = Tmp.c1.set(base).a(base.a + 0.3f + Mathf.absin(Time.globalTime(), 5f, 0.3f));
|
||||
Color color = Tmp.c1.set(base).a(base.a + 0.3f + Mathf.absin(Time.globalTime, 5f, 0.3f));
|
||||
|
||||
float r1 = 1f;
|
||||
float r2 = outlineRad + 0.001f;
|
||||
|
||||
@@ -749,7 +749,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
boolean valid = validPlace(request.x, request.y, request.block, request.rotation);
|
||||
|
||||
Draw.reset();
|
||||
Draw.mixcol(!valid ? Pal.breakInvalid : Color.white, (!valid ? 0.4f : 0.24f) + Mathf.absin(Time.globalTime(), 6f, 0.28f));
|
||||
Draw.mixcol(!valid ? Pal.breakInvalid : Color.white, (!valid ? 0.4f : 0.24f) + Mathf.absin(Time.globalTime, 6f, 0.28f));
|
||||
Draw.alpha(1f);
|
||||
request.block.drawRequestConfigTop(request, selectRequests);
|
||||
Draw.reset();
|
||||
|
||||
@@ -376,8 +376,8 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
|
||||
float radius = Interp.swingIn.apply(crosshairScale);
|
||||
|
||||
Lines.poly(target.getX(), target.getY(), 4, 7f * radius, Time.time() * 1.5f);
|
||||
Lines.spikes(target.getX(), target.getY(), 3f * radius, 6f * radius, 4, Time.time() * 1.5f);
|
||||
Lines.poly(target.getX(), target.getY(), 4, 7f * radius, Time.time * 1.5f);
|
||||
Lines.spikes(target.getX(), target.getY(), 3f * radius, 6f * radius, 4, Time.time * 1.5f);
|
||||
}
|
||||
|
||||
Draw.reset();
|
||||
|
||||
@@ -285,6 +285,8 @@ public class LExecutor{
|
||||
exec.setnum(outX, cache.x);
|
||||
exec.setnum(outY, cache.y);
|
||||
}
|
||||
}else{
|
||||
exec.setbool(outFound, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -502,9 +502,9 @@ public class UnitType extends UnlockableContent{
|
||||
|
||||
//draw back items
|
||||
if(unit.item() != null && unit.itemTime > 0.01f){
|
||||
float size = (itemSize + Mathf.absin(Time.time(), 5f, 1f)) * unit.itemTime;
|
||||
float size = (itemSize + Mathf.absin(Time.time, 5f, 1f)) * unit.itemTime;
|
||||
|
||||
Draw.mixcol(Pal.accent, Mathf.absin(Time.time(), 5f, 0.5f));
|
||||
Draw.mixcol(Pal.accent, Mathf.absin(Time.time, 5f, 0.5f));
|
||||
Draw.rect(unit.item().icon(Cicon.medium),
|
||||
unit.x + Angles.trnsx(unit.rotation + 180f, itemOffsetY),
|
||||
unit.y + Angles.trnsy(unit.rotation + 180f, itemOffsetY),
|
||||
@@ -516,7 +516,7 @@ public class UnitType extends UnlockableContent{
|
||||
Lines.circle(
|
||||
unit.x + Angles.trnsx(unit.rotation + 180f, itemOffsetY),
|
||||
unit.y + Angles.trnsy(unit.rotation + 180f, itemOffsetY),
|
||||
(3f + Mathf.absin(Time.time(), 5f, 1f)) * unit.itemTime);
|
||||
(3f + Mathf.absin(Time.time, 5f, 1f)) * unit.itemTime);
|
||||
|
||||
if(unit.isLocal() && !renderer.pixelator.enabled()){
|
||||
Fonts.outline.draw(unit.stack.amount + "",
|
||||
@@ -538,20 +538,20 @@ public class UnitType extends UnlockableContent{
|
||||
|
||||
if(unit instanceof Trailc){
|
||||
Trail trail = ((Trailc)unit).trail();
|
||||
trail.draw(unit.team.color, (engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f) * scale) * trailScl);
|
||||
trail.draw(unit.team.color, (engineSize + Mathf.absin(Time.time, 2f, engineSize / 4f) * scale) * trailScl);
|
||||
}
|
||||
|
||||
Draw.color(unit.team.color);
|
||||
Fill.circle(
|
||||
unit.x + Angles.trnsx(unit.rotation + 180, offset),
|
||||
unit.y + Angles.trnsy(unit.rotation + 180, offset),
|
||||
(engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f)) * scale
|
||||
(engineSize + Mathf.absin(Time.time, 2f, engineSize / 4f)) * scale
|
||||
);
|
||||
Draw.color(Color.white);
|
||||
Fill.circle(
|
||||
unit.x + Angles.trnsx(unit.rotation + 180, offset - 1f),
|
||||
unit.y + Angles.trnsy(unit.rotation + 180, offset - 1f),
|
||||
(engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f)) / 2f * scale
|
||||
(engineSize + Mathf.absin(Time.time, 2f, engineSize / 4f)) / 2f * scale
|
||||
);
|
||||
Draw.color();
|
||||
}
|
||||
@@ -632,7 +632,7 @@ public class UnitType extends UnlockableContent{
|
||||
}
|
||||
|
||||
public Color cellColor(Unit unit){
|
||||
return Tmp.c1.set(Color.black).lerp(unit.team.color, unit.healthf() + Mathf.absin(Time.time(), Math.max(unit.healthf() * 5f, 1f), 1f - unit.healthf()));
|
||||
return Tmp.c1.set(Color.black).lerp(unit.team.color, unit.healthf() + Mathf.absin(Time.time, Math.max(unit.healthf() * 5f, 1f), 1f - unit.healthf()));
|
||||
}
|
||||
|
||||
public void drawLight(Unit unit){
|
||||
|
||||
@@ -90,7 +90,7 @@ public class Weather extends UnlockableContent{
|
||||
}
|
||||
|
||||
if(!headless && sound != Sounds.none){
|
||||
float noise = soundVolOscMag > 0 ? (float)Math.abs(Noise.rawNoise(Time.time() / soundVolOscScl)) * soundVolOscMag : 0;
|
||||
float noise = soundVolOscMag > 0 ? (float)Math.abs(Noise.rawNoise(Time.time / soundVolOscScl)) * soundVolOscMag : 0;
|
||||
control.sound.loop(sound, Math.max((soundVol + noise) * state.opacity, soundVolMin));
|
||||
}
|
||||
}
|
||||
@@ -120,8 +120,8 @@ public class Weather extends UnlockableContent{
|
||||
float scl = rand.random(0.5f, 1f);
|
||||
float scl2 = rand.random(0.5f, 1f);
|
||||
float size = rand.random(sizeMin, sizeMax);
|
||||
float x = (rand.random(0f, world.unitWidth()) + Time.time() * windx * scl2);
|
||||
float y = (rand.random(0f, world.unitHeight()) + Time.time() * windy * scl);
|
||||
float x = (rand.random(0f, world.unitWidth()) + Time.time * windx * scl2);
|
||||
float y = (rand.random(0f, world.unitHeight()) + Time.time * windy * scl);
|
||||
float alpha = rand.random(minAlpha, maxAlpha);
|
||||
|
||||
x += Mathf.sin(y, rand.random(sinSclMin, sinSclMax), rand.random(sinMagMin, sinMagMax));
|
||||
@@ -155,8 +155,8 @@ public class Weather extends UnlockableContent{
|
||||
float scl = rand.random(0.5f, 1f);
|
||||
float scl2 = rand.random(0.5f, 1f);
|
||||
float size = rand.random(sizeMin, sizeMax);
|
||||
float x = (rand.random(0f, world.unitWidth()) + Time.time() * xspeed * scl2);
|
||||
float y = (rand.random(0f, world.unitHeight()) - Time.time() * yspeed * scl);
|
||||
float x = (rand.random(0f, world.unitWidth()) + Time.time * xspeed * scl2);
|
||||
float y = (rand.random(0f, world.unitHeight()) - Time.time * yspeed * scl);
|
||||
float tint = rand.random(1f) * alpha;
|
||||
|
||||
x -= Tmp.r1.x;
|
||||
@@ -180,7 +180,7 @@ public class Weather extends UnlockableContent{
|
||||
int total = (int)(Tmp.r1.area() / density * intensity) / 2;
|
||||
Lines.stroke(stroke);
|
||||
|
||||
float t = Time.time() / timeScale;
|
||||
float t = Time.time / timeScale;
|
||||
|
||||
for(int i = 0; i < total; i++){
|
||||
float offset = rand.random(0f, 1f);
|
||||
@@ -227,7 +227,7 @@ public class Weather extends UnlockableContent{
|
||||
float windx = vwindx * speed, windy = vwindy * speed;
|
||||
|
||||
float scale = 1f / noisescl;
|
||||
float scroll = Time.time() * scale + offset;
|
||||
float scroll = Time.time * scale + offset;
|
||||
Tmp.tr1.texture = noise;
|
||||
Core.camera.bounds(Tmp.r1);
|
||||
Tmp.tr1.set(Tmp.r1.x*scale, Tmp.r1.y*scale, (Tmp.r1.x + Tmp.r1.width)*scale, (Tmp.r1.y + Tmp.r1.height)*scale);
|
||||
|
||||
@@ -199,7 +199,7 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
void refreshServer(Server server){
|
||||
server.content.clear();
|
||||
server.content.label(() -> Core.bundle.get("server.refreshing") + Strings.animated(Time.time(), 4, 11, "."));
|
||||
server.content.label(() -> Core.bundle.get("server.refreshing") + Strings.animated(Time.time, 4, 11, "."));
|
||||
|
||||
net.pingHost(server.ip, server.port, host -> setupServer(server, host), e -> {
|
||||
server.content.clear();
|
||||
@@ -340,7 +340,7 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
local.clear();
|
||||
local.background(null);
|
||||
local.table(Tex.button, t -> t.label(() -> "[accent]" + Core.bundle.get("hosts.discovering.any") + Strings.animated(Time.time(), 4, 10f, ".")).pad(10f)).growX();
|
||||
local.table(Tex.button, t -> t.label(() -> "[accent]" + Core.bundle.get("hosts.discovering.any") + Strings.animated(Time.time, 4, 10f, ".")).pad(10f)).growX();
|
||||
net.discoverServers(this::addLocalHost, this::finishLocalHosts);
|
||||
}
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
|
||||
Color color =
|
||||
sec.hasBase() ? Tmp.c2.set(Team.sharded.color).lerp(Team.crux.color, sec.hasEnemyBase() ? 0.5f : 0f) :
|
||||
sec.preset != null ? Tmp.c2.set(Team.derelict.color).lerp(Color.white, Mathf.absin(Time.time(), 10f, 1f)) :
|
||||
sec.preset != null ? Tmp.c2.set(Team.derelict.color).lerp(Color.white, Mathf.absin(Time.time, 10f, 1f)) :
|
||||
sec.hasEnemyBase() ? Team.crux.color :
|
||||
null;
|
||||
|
||||
@@ -627,6 +627,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
Table stable = sectorTop;
|
||||
|
||||
if(sector == null){
|
||||
stable.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ public class HudFragment extends Fragment{
|
||||
t.name = "nearpoint";
|
||||
t.touchable = Touchable.disabled;
|
||||
t.table(Styles.black, c -> c.add("@nearpoint")
|
||||
.update(l -> l.setColor(Tmp.c1.set(Color.white).lerp(Color.scarlet, Mathf.absin(Time.time(), 10f, 1f))))
|
||||
.update(l -> l.setColor(Tmp.c1.set(Color.white).lerp(Color.scarlet, Mathf.absin(Time.time, 10f, 1f))))
|
||||
.get().setAlignment(Align.center, Align.center))
|
||||
.margin(6).update(u -> u.color.a = Mathf.lerpDelta(u.color.a, Mathf.num(spawner.playerNear()), 0.1f)).get().color.a = 0f;
|
||||
});
|
||||
@@ -317,7 +317,7 @@ public class HudFragment extends Fragment{
|
||||
return coreAttackOpacity[0] > 0;
|
||||
});
|
||||
t.table(Tex.button, top -> top.add("@coreattack").pad(2)
|
||||
.update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
|
||||
.update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f)))).touchable(Touchable.disabled);
|
||||
});
|
||||
|
||||
//'saving' indicator
|
||||
|
||||
@@ -392,7 +392,7 @@ public class Block extends UnlockableContent{
|
||||
|
||||
public void drawRequest(BuildPlan req, Eachable<BuildPlan> list, boolean valid){
|
||||
Draw.reset();
|
||||
Draw.mixcol(!valid ? Pal.breakInvalid : Color.white, (!valid ? 0.4f : 0.24f) + Mathf.absin(Time.globalTime(), 6f, 0.28f));
|
||||
Draw.mixcol(!valid ? Pal.breakInvalid : Color.white, (!valid ? 0.4f : 0.24f) + Mathf.absin(Time.globalTime, 6f, 0.28f));
|
||||
Draw.alpha(1f);
|
||||
float prevScale = Draw.scl;
|
||||
Draw.scl *= req.animScale;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DirectionalItemBuffer{
|
||||
|
||||
public void accept(int buffer, Item item){
|
||||
if(!accepts(buffer)) return;
|
||||
buffers[buffer][indexes[buffer]++] = BufferItem.get((byte)item.id, Time.time());
|
||||
buffers[buffer][indexes[buffer]++] = BufferItem.get((byte)item.id, Time.time);
|
||||
}
|
||||
|
||||
public Item poll(int buffer, float speed){
|
||||
@@ -31,7 +31,7 @@ public class DirectionalItemBuffer{
|
||||
long l = buffers[buffer][0];
|
||||
float time = BufferItem.time(l);
|
||||
|
||||
if(Time.time() >= time + speed || Time.time() < time){
|
||||
if(Time.time >= time + speed || Time.time < time){
|
||||
return content.item(BufferItem.item(l));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ItemBuffer{
|
||||
|
||||
public void accept(Item item, short data){
|
||||
//if(!accepts()) return;
|
||||
buffer[index++] = Pack.longInt(Float.floatToIntBits(Time.time()), Pack.shortInt(item.id, data));
|
||||
buffer[index++] = Pack.longInt(Float.floatToIntBits(Time.time), Pack.shortInt(item.id, data));
|
||||
}
|
||||
|
||||
public void accept(Item item){
|
||||
@@ -32,7 +32,7 @@ public class ItemBuffer{
|
||||
long l = buffer[0];
|
||||
float time = Float.intBitsToFloat(Pack.leftInt(l));
|
||||
|
||||
if(Time.time() >= time + speed || Time.time() < time){
|
||||
if(Time.time >= time + speed || Time.time < time){
|
||||
return content.item(Pack.leftShort(Pack.rightInt(l)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class Accelerator extends Block{
|
||||
|
||||
for(int l = 0; l < 4; l++){
|
||||
float length = 7f + l * 5f;
|
||||
Draw.color(team.color, Pal.darkMetal, Mathf.absin(Time.time() + l*50f, 10f, 1f));
|
||||
Draw.color(team.color, Pal.darkMetal, Mathf.absin(Time.time + l*50f, 10f, 1f));
|
||||
|
||||
for(int i = 0; i < 4; i++){
|
||||
float rot = i*90f + 45f;
|
||||
@@ -67,13 +67,13 @@ public class Accelerator extends Block{
|
||||
Lines.square(x, y, rad * 1.22f, 45f);
|
||||
|
||||
Lines.stroke(3f, Pal.accent);
|
||||
Lines.square(x, y, rad, Time.time() / scl);
|
||||
Lines.square(x, y, rad, -Time.time() / scl);
|
||||
Lines.square(x, y, rad, Time.time / scl);
|
||||
Lines.square(x, y, rad, -Time.time / scl);
|
||||
|
||||
Draw.color(team.color);
|
||||
|
||||
for(int i = 0; i < 4; i++){
|
||||
float rot = i*90f + 45f + (-Time.time()/3f)%360f;
|
||||
float rot = i*90f + 45f + (-Time.time /3f)%360f;
|
||||
float length = 26f;
|
||||
Draw.rect(arrowRegion, x + Angles.trnsx(rot, length), y + Angles.trnsy(rot, length), rot + 180f);
|
||||
}
|
||||
|
||||
@@ -104,10 +104,10 @@ public class MendProjector extends Block{
|
||||
public void draw(){
|
||||
super.draw();
|
||||
|
||||
float f = 1f - (Time.time() / 100f) % 1f;
|
||||
float f = 1f - (Time.time / 100f) % 1f;
|
||||
|
||||
Draw.color(baseColor, phaseColor, phaseHeat);
|
||||
Draw.alpha(heat * Mathf.absin(Time.time(), 10f, 1f) * 0.5f);
|
||||
Draw.alpha(heat * Mathf.absin(Time.time, 10f, 1f) * 0.5f);
|
||||
Draw.rect(topRegion, x, y);
|
||||
Draw.alpha(1f);
|
||||
Lines.stroke((2f * f + 0.2f) * heat);
|
||||
|
||||
@@ -114,10 +114,10 @@ public class OverdriveProjector extends Block{
|
||||
public void draw(){
|
||||
super.draw();
|
||||
|
||||
float f = 1f - (Time.time() / 100f) % 1f;
|
||||
float f = 1f - (Time.time / 100f) % 1f;
|
||||
|
||||
Draw.color(baseColor, phaseColor, phaseHeat);
|
||||
Draw.alpha(heat * Mathf.absin(Time.time(), 10f, 1f) * 0.5f);
|
||||
Draw.alpha(heat * Mathf.absin(Time.time, 10f, 1f) * 0.5f);
|
||||
Draw.rect(topRegion, x, y);
|
||||
Draw.alpha(1f);
|
||||
Lines.stroke((2f * f + 0.1f) * heat);
|
||||
|
||||
@@ -114,7 +114,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
int frame = enabled && clogHeat <= 0.5f ? (int)(((Time.time() * speed * 8f * timeScale())) % 4) : 0;
|
||||
int frame = enabled && clogHeat <= 0.5f ? (int)(((Time.time * speed * 8f * timeScale())) % 4) : 0;
|
||||
|
||||
//draw extra conveyors facing this one for non-square tiling purposes
|
||||
Draw.z(Layer.blockUnder);
|
||||
|
||||
@@ -170,7 +170,7 @@ public class ItemBridge extends Block{
|
||||
Tmp.v2.trns(tile.angleTo(other), 2f);
|
||||
float tx = tile.drawx(), ty = tile.drawy();
|
||||
float ox = other.drawx(), oy = other.drawy();
|
||||
float alpha = Math.abs((linked ? 100 : 0)-(Time.time() * 2f) % 100f) / 100f;
|
||||
float alpha = Math.abs((linked ? 100 : 0)-(Time.time * 2f) % 100f) / 100f;
|
||||
float x = Mathf.lerp(ox, tx, alpha);
|
||||
float y = Mathf.lerp(oy, ty, alpha);
|
||||
|
||||
@@ -207,7 +207,7 @@ public class ItemBridge extends Block{
|
||||
boolean linked = other.pos() == link;
|
||||
|
||||
Drawf.select(other.drawx(), other.drawy(),
|
||||
other.block().size * tilesize / 2f + 2f + (linked ? 0f : Mathf.absin(Time.time(), 4f, 1f)), linked ? Pal.place : Pal.breakInvalid);
|
||||
other.block().size * tilesize / 2f + 2f + (linked ? 0f : Mathf.absin(Time.time, 4f, 1f)), linked ? Pal.place : Pal.breakInvalid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,7 +298,7 @@ public class ItemBridge extends Block{
|
||||
|
||||
int i = relativeTo(other.x, other.y);
|
||||
|
||||
Draw.color(Color.white, Color.black, Mathf.absin(Time.time(), 6f, 0.07f));
|
||||
Draw.color(Color.white, Color.black, Mathf.absin(Time.time, 6f, 0.07f));
|
||||
Draw.alpha(Math.max(uptime, 0.25f) * opacity);
|
||||
|
||||
Draw.rect(endRegion, x, y, i * 90 + 90);
|
||||
|
||||
@@ -44,7 +44,7 @@ public class Junction extends Block{
|
||||
long l = buffer.buffers[i][0];
|
||||
float time = BufferItem.time(l);
|
||||
|
||||
if(Time.time() >= time + speed / timeScale || Time.time() < time){
|
||||
if(Time.time >= time + speed / timeScale || Time.time < time){
|
||||
|
||||
Item item = content.item(BufferItem.item(l));
|
||||
Building dest = nearby(i);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MassDriver extends Block{
|
||||
if(selected == null || !(selected.block instanceof MassDriver) || !(selected.within(x * tilesize, y * tilesize, range))) return;
|
||||
|
||||
//if so, draw a dotted line towards it while it is in range
|
||||
float sin = Mathf.absin(Time.time(), 6f, 1f);
|
||||
float sin = Mathf.absin(Time.time, 6f, 1f);
|
||||
Tmp.v1.set(x * tilesize + offset, y * tilesize + offset).sub(selected.x, selected.y).limit((size / 2f + 1) * tilesize + sin + 0.5f);
|
||||
float x2 = x * tilesize - Tmp.v1.x, y2 = y * tilesize - Tmp.v1.y,
|
||||
x1 = selected.x + Tmp.v1.x, y1 = selected.y + Tmp.v1.y;
|
||||
@@ -202,7 +202,7 @@ public class MassDriver extends Block{
|
||||
|
||||
@Override
|
||||
public void drawConfigure(){
|
||||
float sin = Mathf.absin(Time.time(), 6f, 1f);
|
||||
float sin = Mathf.absin(Time.time, 6f, 1f);
|
||||
|
||||
Draw.color(Pal.accent);
|
||||
Lines.stroke(1f);
|
||||
|
||||
@@ -204,7 +204,7 @@ public class PayloadConveyor extends Block{
|
||||
}
|
||||
|
||||
public float time(){
|
||||
return Time.time();
|
||||
return Time.time;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,7 @@ public class TreeBlock extends Block{
|
||||
public void drawBase(Tile tile){
|
||||
|
||||
float x = tile.worldx(), y = tile.worldy();
|
||||
float rot = Mathf.randomSeed(tile.pos(), 0, 4) * 90 + Mathf.sin(Time.time() + x, 50f, 0.5f) + Mathf.sin(Time.time() - y, 65f, 0.9f) + Mathf.sin(Time.time() + y - x, 85f, 0.9f);
|
||||
float rot = Mathf.randomSeed(tile.pos(), 0, 4) * 90 + Mathf.sin(Time.time + x, 50f, 0.5f) + Mathf.sin(Time.time - y, 65f, 0.9f) + Mathf.sin(Time.time + y - x, 85f, 0.9f);
|
||||
float w = region.width * Draw.scl, h = region.height * Draw.scl;
|
||||
float scl = 30f, mag = 0.2f;
|
||||
|
||||
@@ -34,8 +34,8 @@ public class TreeBlock extends Block{
|
||||
Draw.z(Layer.power + 1);
|
||||
Draw.rectv(region, x, y, w, h, rot, vec -> {
|
||||
vec.add(
|
||||
Mathf.sin(vec.y*3 + Time.time(), scl, mag) + Mathf.sin(vec.x*3 - Time.time(), 70, 0.8f),
|
||||
Mathf.cos(vec.x*3 + Time.time() + 8, scl + 6f, mag * 1.1f) + Mathf.sin(vec.y*3 - Time.time(), 50, 0.2f)
|
||||
Mathf.sin(vec.y*3 + Time.time, scl, mag) + Mathf.sin(vec.x*3 - Time.time, 70, 0.8f),
|
||||
Mathf.cos(vec.x*3 + Time.time + 8, scl + 6f, mag * 1.1f) + Mathf.sin(vec.y*3 - Time.time, 50, 0.2f)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -101,12 +101,12 @@ public class ImpactReactor extends PowerGenerator{
|
||||
Draw.rect(bottomRegion, x, y);
|
||||
|
||||
for(int i = 0; i < plasmaRegions.length; i++){
|
||||
float r = size * tilesize - 3f + Mathf.absin(Time.time(), 2f + i * 1f, 5f - i * 0.5f);
|
||||
float r = size * tilesize - 3f + Mathf.absin(Time.time, 2f + i * 1f, 5f - i * 0.5f);
|
||||
|
||||
Draw.color(plasma1, plasma2, (float)i / plasmaRegions.length);
|
||||
Draw.alpha((0.3f + Mathf.absin(Time.time(), 2f + i * 2f, 0.3f + i * 0.05f)) * warmup);
|
||||
Draw.alpha((0.3f + Mathf.absin(Time.time, 2f + i * 2f, 0.3f + i * 0.05f)) * warmup);
|
||||
Draw.blend(Blending.additive);
|
||||
Draw.rect(plasmaRegions[i], x, y, r, r, Time.time() * (12 + i * 6f) * warmup);
|
||||
Draw.rect(plasmaRegions[i], x, y, r, r, Time.time * (12 + i * 6f) * warmup);
|
||||
Draw.blend();
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
||||
|
||||
if(hasItems){
|
||||
Draw.color(heatColor);
|
||||
Draw.alpha(heat * 0.4f + Mathf.absin(Time.time(), 8f, 0.6f) * heat);
|
||||
Draw.alpha(heat * 0.4f + Mathf.absin(Time.time, 8f, 0.6f) * heat);
|
||||
Draw.rect(topRegion, x, y);
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ public class PowerNode extends PowerBlock{
|
||||
@Override
|
||||
public void drawConfigure(){
|
||||
|
||||
Drawf.circles(x, y, tile.block().size * tilesize / 2f + 1f + Mathf.absin(Time.time(), 4f, 1f));
|
||||
Drawf.circles(x, y, tile.block().size * tilesize / 2f + 1f + Mathf.absin(Time.time, 4f, 1f));
|
||||
Drawf.circles(x, y, laserRange * tilesize);
|
||||
|
||||
for(int x = (int)(tile.x - laserRange - 2); x <= tile.x + laserRange + 2; x++){
|
||||
|
||||
@@ -78,7 +78,7 @@ public class Cultivator extends GenericCrafter{
|
||||
for(int i = 0; i < 12; i++){
|
||||
float offset = random.nextFloat() * 999999f;
|
||||
float x = random.range(4f), y = random.range(4f);
|
||||
float life = 1f - (((Time.time() + offset) / 50f) % recurrence);
|
||||
float life = 1f - (((Time.time + offset) / 50f) % recurrence);
|
||||
|
||||
if(life > 0){
|
||||
Lines.stroke(warmup * (life * 1f + 0.2f));
|
||||
|
||||
@@ -291,7 +291,7 @@ public class Drill extends Block{
|
||||
|
||||
if(drawRim){
|
||||
Draw.color(heatColor);
|
||||
Draw.alpha(warmup * ts * (1f - s + Mathf.absin(Time.time(), 3f, s)));
|
||||
Draw.alpha(warmup * ts * (1f - s + Mathf.absin(Time.time, 3f, s)));
|
||||
Draw.blend(Blending.additive);
|
||||
Draw.rect(rimRegion, x, y);
|
||||
Draw.blend();
|
||||
|
||||
@@ -30,13 +30,13 @@ public class GenericSmelter extends GenericCrafter{
|
||||
float r = 0.06f;
|
||||
float cr = Mathf.random(0.1f);
|
||||
|
||||
Draw.alpha(((1f - g) + Mathf.absin(Time.time(), 8f, g) + Mathf.random(r) - r) * warmup);
|
||||
Draw.alpha(((1f - g) + Mathf.absin(Time.time, 8f, g) + Mathf.random(r) - r) * warmup);
|
||||
|
||||
Draw.tint(flameColor);
|
||||
Fill.circle(x, y, 3f + Mathf.absin(Time.time(), 5f, 2f) + cr);
|
||||
Fill.circle(x, y, 3f + Mathf.absin(Time.time, 5f, 2f) + cr);
|
||||
Draw.color(1f, 1f, 1f, warmup);
|
||||
Draw.rect(topRegion, x, y);
|
||||
Fill.circle(x, y, 1.9f + Mathf.absin(Time.time(), 5f, 1f) + cr);
|
||||
Fill.circle(x, y, 1.9f + Mathf.absin(Time.time, 5f, 1f) + cr);
|
||||
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Incinerator extends Block{
|
||||
float g = 0.3f;
|
||||
float r = 0.06f;
|
||||
|
||||
Draw.alpha(((1f - g) + Mathf.absin(Time.time(), 8f, g) + Mathf.random(r) - r) * heat);
|
||||
Draw.alpha(((1f - g) + Mathf.absin(Time.time, 8f, g) + Mathf.random(r) - r) * heat);
|
||||
|
||||
Draw.tint(flameColor);
|
||||
Fill.circle(x, y, 2f);
|
||||
|
||||
Reference in New Issue
Block a user