New breaking animation and colors

This commit is contained in:
Anuken
2018-05-21 00:27:01 -04:00
parent 2108aab523
commit ed7e77b2db
15 changed files with 73 additions and 27 deletions

View File

@@ -84,7 +84,7 @@ public class AndroidInput extends InputHandler{
}
if(linked != null) {
linked.block().tapped(linked);
linked.block().tapped(linked, player);
if(Net.active()) NetEvents.handleBlockTap(linked);
}
}

View File

@@ -160,7 +160,7 @@ public class DesktopInput extends InputHandler{
}
}
target.block().tapped(target);
target.block().tapped(target, player);
if(Net.active()) NetEvents.handleBlockTap(target);
}

View File

@@ -198,7 +198,9 @@ public abstract class InputHandler extends InputAdapter{
}
public void breakBlock(int x, int y){
//todo multiplayer support
player.addBuildRequest(new BuildRequest(x, y));
Tile tile = world.tile(x, y).target();
player.addBuildRequest(new BuildRequest(tile.x, tile.y));
}
}

View File

@@ -39,7 +39,7 @@ public enum PlaceMode{
float si = MathUtils.sin(Timers.time() / 6f) + 1.5f;
Draw.color(valid ? Colors.get("place") : Colors.get("placeInvalid"));
Draw.color(valid ? Colors.get("place") : Colors.get("break"));
Lines.stroke(2f);
Lines.crect(x + offset.x, y + offset.y, tilesize * input.recipe.result.size + si,
tilesize * input.recipe.result.size + si);
@@ -189,7 +189,6 @@ public enum PlaceMode{
for(int cx = tilex; cx <= endx; cx ++){
for(int cy = tiley; cy <= endy; cy ++){
input.tryDeleteBlock(cx, cy);
}
}
}
@@ -281,7 +280,7 @@ public enum PlaceMode{
int wx = tilex + px * Mathf.sign(endx - tilex),
wy = tiley + py * Mathf.sign(endy - tiley);
if(!Build.validPlace(input.player.team, wx, wy, block, rotation)){
Draw.color("placeInvalid");
Draw.color("break");
}else{
Draw.color("accent");
}