Cleanup
This commit is contained in:
22
core/src/mindustry/entities/def/VelComp.java
Normal file
22
core/src/mindustry/entities/def/VelComp.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package mindustry.entities.def;
|
||||
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@Component
|
||||
abstract class VelComp implements Posc{
|
||||
transient float x, y;
|
||||
|
||||
final Vec2 vel = new Vec2();
|
||||
float drag = 0f;
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
//TODO handle solidity
|
||||
x += vel.x;
|
||||
y += vel.y;
|
||||
vel.scl(1f - drag * Time.delta());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user