Sprite tweaks

This commit is contained in:
Anuken 2020-06-05 20:59:30 -04:00
parent 28fb6a7d2a
commit 65e94850ca
15 changed files with 17 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 715 B

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 845 KiB

After

Width:  |  Height:  |  Size: 848 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 KiB

After

Width:  |  Height:  |  Size: 915 KiB

View File

@ -38,8 +38,8 @@ public class BuilderAI extends AIController{
}else{
//find new request
if(!unit.team().data().blocks.isEmpty()){
Queue<BrokenBlock> blocks = unit.team().data().blocks;
BrokenBlock block = blocks.first();
Queue<BlockPlan> blocks = unit.team().data().blocks;
BlockPlan block = blocks.first();
//check if it's already been placed
if(world.tile(block.x, block.y) != null && world.tile(block.x, block.y).block().id == block.block){

View File

@ -66,22 +66,22 @@ public class Logic implements ApplicationListener{
//remove existing blocks that have been placed here.
//painful O(n) iteration + copy
for(int i = 0; i < data.blocks.size; i++){
BrokenBlock b = data.blocks.get(i);
BlockPlan b = data.blocks.get(i);
if(b.x == tile.x && b.y == tile.y){
data.blocks.removeIndex(i);
break;
}
}
data.blocks.addFirst(new BrokenBlock(tile.x, tile.y, tile.rotation(), block.id, tile.entity.config()));
data.blocks.addFirst(new BlockPlan(tile.x, tile.y, tile.rotation(), block.id, tile.entity.config()));
});
Events.on(BlockBuildEndEvent.class, event -> {
if(!event.breaking){
TeamData data = state.teams.get(event.team);
Iterator<BrokenBlock> it = data.blocks.iterator();
Iterator<BlockPlan> it = data.blocks.iterator();
while(it.hasNext()){
BrokenBlock b = it.next();
BlockPlan b = it.next();
Block block = content.block(b.block);
if(event.tile.block().bounds(event.tile.x, event.tile.y, Tmp.r1).overlaps(block.bounds(b.x, b.y, Tmp.r2))){
it.remove();

View File

@ -148,7 +148,7 @@ public class Teams{
public final Array<CoreEntity> cores = new Array<>();
public final Array<Team> enemies = new Array<>();
public final Team team;
public Queue<BrokenBlock> blocks = new Queue<>();
public Queue<BlockPlan> blocks = new Queue<>();
public BaseAI ai = new BaseAI();
public TeamData(Team team){
@ -187,11 +187,11 @@ public class Teams{
/** Represents a block made by this team that was destroyed somewhere on the map.
* This does not include deconstructed blocks.*/
public static class BrokenBlock{
public static class BlockPlan{
public final short x, y, rotation, block;
public final Object config;
public BrokenBlock(short x, short y, short rotation, short block, Object config){
public BlockPlan(short x, short y, short rotation, short block, Object config){
this.x = x;
this.y = y;
this.rotation = rotation;

View File

@ -120,7 +120,7 @@ public class BlockRenderer implements Disposable{
}
if(brokenFade > 0.001f){
for(BrokenBlock block : state.teams.get(player.team()).blocks){
for(BlockPlan block : state.teams.get(player.team()).blocks){
Block b = content.block(block.block);
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;

View File

@ -507,7 +507,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
}
for(BrokenBlock req : player.team().data().blocks){
for(BlockPlan req : player.team().data().blocks){
Block block = content.block(req.block);
if(block.bounds(req.x, req.y, Tmp.r2).overlaps(Tmp.r1)){
drawSelected(req.x, req.y, content.block(req.block), Pal.remove);
@ -629,9 +629,9 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
//remove blocks to rebuild
Iterator<BrokenBlock> broken = state.teams.get(player.team()).blocks.iterator();
Iterator<BlockPlan> broken = state.teams.get(player.team()).blocks.iterator();
while(broken.hasNext()){
BrokenBlock req = broken.next();
BlockPlan req = broken.next();
Block block = content.block(req.block);
if(block.bounds(req.x, req.y, Tmp.r2).overlaps(Tmp.r1)){
broken.remove();

View File

@ -270,7 +270,7 @@ public abstract class SaveVersion extends SaveFileReader{
for(TeamData team : data){
stream.writeInt(team.team.id);
stream.writeInt(team.blocks.size);
for(BrokenBlock block : team.blocks){
for(BlockPlan block : team.blocks){
stream.writeShort(block.x);
stream.writeShort(block.y);
stream.writeShort(block.rotation);
@ -297,7 +297,7 @@ public abstract class SaveVersion extends SaveFileReader{
TeamData data = team.data();
int blocks = stream.readInt();
for(int j = 0; j < blocks; j++){
data.blocks.addLast(new BrokenBlock(stream.readShort(), stream.readShort(), stream.readShort(), content.block(stream.readShort()).id, TypeIO.readObject(Reads.get(stream))));
data.blocks.addLast(new BlockPlan(stream.readShort(), stream.readShort(), stream.readShort(), content.block(stream.readShort()).id, TypeIO.readObject(Reads.get(stream))));
}
}

View File

@ -21,7 +21,7 @@ public class Save3 extends LegacySaveVersion{
TeamData data = team.data();
int blocks = stream.readInt();
for(int j = 0; j < blocks; j++){
data.blocks.addLast(new BrokenBlock(stream.readShort(), stream.readShort(), stream.readShort(), content.block(stream.readShort()).id, stream.readInt()));
data.blocks.addLast(new BlockPlan(stream.readShort(), stream.readShort(), stream.readShort(), content.block(stream.readShort()).id, stream.readInt()));
}
}

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=02f15d353cddc9725ad46bafeeae77c3f2719bac
archash=930b894ae4bf0ce21d331f97cf06db9c5077711f