Implemented conveyor item access

This commit is contained in:
Anuken
2018-04-15 13:05:18 -04:00
parent 97e5ac4c1e
commit 01fc7108d8
8 changed files with 131 additions and 108 deletions

View File

@@ -6,6 +6,7 @@ import io.anuke.mindustry.Vars;
import io.anuke.mindustry.resource.Item;
import io.anuke.ucore.entities.Entity;
import io.anuke.ucore.entities.TimedEntity;
import io.anuke.ucore.function.Callable;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.util.Mathf;
@@ -16,19 +17,27 @@ public class ItemAnimationEffect extends TimedEntity {
private final Vector2 from = new Vector2();
private final Vector2 to = new Vector2();
private final Item item;
private final Callable removed;
public Interpolation interp = Interpolation.fade;
public float endSize = 0.8f;
public float endSize = 0.9f;
public ItemAnimationEffect(Item item, float x, float y, float tox, float toy) {
public ItemAnimationEffect(Item item, float x, float y, float tox, float toy, Callable removed) {
this.x = x;
this.y = y;
this.item = item;
this.removed = removed;
from.set(x, y);
to.set(tox, toy);
lifetime = 40f;
}
@Override
public void removed() {
super.removed();
removed.run();
}
@Override
public void update() {
super.update();