1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-22 22:07:31 +03:00

Improved VTOL animation, made power nodes circular

This commit is contained in:
Anuken 2018-04-29 10:46:14 -04:00
parent b589d8a1df
commit 37fcd81e87
18 changed files with 1350 additions and 1298 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 617 B

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -85,13 +85,16 @@ public class PowerBlocks {
hasItems = false;
}},
powernode = new PowerDistributor("powernode"),
powernode = new PowerDistributor("powernode"){{
shadow = "powernode-shadow";
}},
powernodelarge = new PowerDistributor("powernodelarge"){{
size = 2;
powerSpeed = 1f;
maxNodes = 5;
laserRange = 7.5f;
shadow = "powernodelarge-shadow";
}},
teleporter = new Teleporter("teleporter");

View File

@ -1,6 +1,5 @@
package io.anuke.mindustry.entities.units.types;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.content.AmmoTypes;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.entities.units.BaseUnit;
@ -8,7 +7,6 @@ import io.anuke.mindustry.entities.units.FlyingUnitType;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
@ -26,33 +24,21 @@ public class Vtol extends FlyingUnitType {
for(int i : Mathf.signs) {
float rotation = unit.rotation - 90;
float dx = 5f * i, dx2 = 6f * i;
float dy = 4f, dy2 = -5f;
float scl = 0.7f + Mathf.absin(Timers.time(), 3f, 0.2f);
float dx = 5f * i*scl, dx2 = 6f * i*scl;
float dy = 4f*scl, dy2 = -5f*scl;
float rad = 1.5f + Mathf.absin(Timers.time(), 3f, 0.6f);
float ds = 1.2f;
Draw.color(Palette.lighterOrange, Palette.lightFlame, Mathf.absin(Timers.time(), 3f, 0.7f));
Draw.color(Palette.lightishOrange, Palette.lightFlame, Mathf.absin(Timers.time(), 3f, 0.3f));
Fill.circle(
Draw.rect("vtol-flame",
unit.x + Angles.trnsx(rotation, dx, dy),
unit.y + Angles.trnsy(rotation, dx, dy), rad);
unit.y + Angles.trnsy(rotation, dx, dy), Mathf.atan2(dx, dy));
Fill.circle(
Draw.rect("vtol-flame",
unit.x + Angles.trnsx(rotation, dx2, dy2),
unit.y + Angles.trnsy(rotation, dx2, dy2), rad);
unit.y + Angles.trnsy(rotation, dx2, dy2), Mathf.atan2(dx2, dy2));
Draw.color(Color.GRAY);
Fill.circle(
unit.x + Angles.trnsx(rotation, dx, dy)/ds,
unit.y + Angles.trnsy(rotation, dx, dy)/ds, 2f);
Fill.circle(
unit.x + Angles.trnsx(rotation, dx2, dy2)/ds,
unit.y + Angles.trnsy(rotation, dx2, dy2)/ds, 2f);
Draw.color(Color.WHITE);
Draw.color();
}

View File

@ -69,8 +69,8 @@ public class Block extends BaseBlock {
public int health = 40;
/**base block explosiveness*/
public float baseExplosiveness = 0f;
/**the shadow drawn under the block*/
public String shadow = "shadow";
/**the shadow drawn under the block. use 'null' to indicate the default shadow for this block.*/
public String shadow = null;
/**whether to display a different shadow per variant*/
public boolean varyShadow = false;
/**edge fallback, used mainly for ores*/
@ -344,10 +344,12 @@ public class Block extends BaseBlock {
public void drawShadow(Tile tile){
if(varyShadow && variants > 0){
if(varyShadow && variants > 0 && shadow != null) {
Draw.rect(shadow + (Mathf.randomSeed(tile.id(), 1, variants)), tile.worldx(), tile.worldy());
}else if(shadow != null){
Draw.rect(shadow, tile.drawx(), tile.drawy());
}else{
Draw.rect(shadow, tile.worldx(), tile.worldy());
Draw.rect("shadow-" + size, tile.drawx(), tile.drawy());
}
}

View File

@ -20,6 +20,11 @@ public class BlockPart extends Block{
public void draw(Tile tile){
//do nothing
}
@Override
public void drawShadow(Tile tile){
//also do nothing
}
@Override
public boolean isSolidFor(Tile tile){