Re-made all maps, added block smoke effects

This commit is contained in:
Anuken 2017-05-20 12:56:02 -04:00
parent c74a8a2fa6
commit 6381fbc52d
12 changed files with 27 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -83,6 +83,13 @@ public class EffectLoader{
Draw.reset();
});
Effect.create("smoke", 100, e -> {
Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), e.ifract());
float size = 7f-e.ifract()*7f;
Draw.rect("circle", e.x, e.y, size, size);
Draw.reset();
});
Effect.create("spawn", 23, e -> {
Draw.thickness(2f);
Draw.color(Hue.mix(Color.DARK_GRAY, Color.SCARLET, e.ifract()));

View File

@ -15,11 +15,11 @@ public class PassTileGraph implements IndexedGraph<Tile>{
public Array<Connection<Tile>> getConnections(Tile fromNode){
tempConnections.clear();
if(fromNode.block().solid && !fromNode.block().update)
if(!fromNode.passable())
return tempConnections;
for(Tile tile : fromNode.getNearby()){
if(tile != null && (!tile.block().solid || tile.block().update))
if(tile != null && (tile.passable()))
tempConnections.add(new TileConnection(fromNode, tile));
}

View File

@ -9,6 +9,7 @@ import io.anuke.mindustry.world.blocks.Blocks;
import io.anuke.mindustry.world.blocks.ProductionBlocks;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.entities.Entity;
import io.anuke.ucore.util.Mathf;
public class TileEntity extends Entity{
public Tile tile;
@ -54,6 +55,12 @@ public class TileEntity extends Entity{
@Override
public void update(){
if(health != 0 && !tile.block().name().contains("block") &&
Mathf.chance(0.009f*delta*(1f-(float)health/maxhealth))){
Effects.effect("smoke", x+Mathf.range(4), y+Mathf.range(4));
}
tile.block().update(tile);
}

View File

@ -46,7 +46,7 @@ public class LevelDialog extends Dialog{
image.clicked(()->{
selectedMap = index;
});
image.getImageCell().size(150, 150);
image.getImageCell().size(164);
content().add(image).size(180);
}

View File

@ -24,6 +24,7 @@ public class Generator{
Hue.rgb(80, 110, 180), Blocks.water,
Hue.rgb(70, 90, 150), Blocks.deepwater,
Hue.rgb(110, 80, 30), Blocks.dirt,
Hue.rgb(160, 120, 70), Blocks.dirtblock,
Hue.rgb(100, 100, 100), Blocks.stoneblock
);
@ -50,6 +51,7 @@ public class Generator{
core = tiles[x][y];
}else if(color == spawn){
spawnpoints.add(tiles[x][y]);
floor = Blocks.dirt;
}else{
if(Mathf.chance(0.02)){
block = Mathf.choose(Blocks.rock, Blocks.rock2);

View File

@ -64,6 +64,14 @@ public class Tile{
this.floor = type;
}
public boolean passable(){
return !(floor.solid || (block.solid && !block.update));
}
public boolean solid(){
return block.solid || floor.solid;
}
public boolean breakable(){
return block.update || block.breakable;
}