Implemented ground mech boosting

This commit is contained in:
Anuken
2020-05-20 18:48:04 -04:00
parent 78f24b8840
commit 5b445c59c1
62 changed files with 610 additions and 638 deletions

View File

@@ -0,0 +1,27 @@
package mindustry.entities.comp;
import arc.math.*;
import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.gen.*;
@Component
abstract class TimedComp implements Entityc, Scaled{
float time, lifetime;
//called last so pooling and removal happens then.
@MethodPriority(100)
@Override
public void update(){
time = Math.min(time + Time.delta(), lifetime);
if(time >= lifetime){
remove();
}
}
@Override
public float fin(){
return time / lifetime;
}
}