mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-06 16:27:34 +07:00
Added run and walk speeds to VelocityComponent
Added run and walk speeds to VelocityComponent Added RUNNING flag to tell if entity should use run or walk speed
This commit is contained in:
@ -6,6 +6,7 @@ public final class Flags {
|
||||
public static final int SELECTABLE = 1 << 1;
|
||||
public static final int SELECTED = 1 << 2;
|
||||
public static final int INVISIBLE = 1 << 3;
|
||||
public static final int RUNNING = 1 << 4;
|
||||
|
||||
public static String toString(int bits) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
@ -16,6 +17,7 @@ public final class Flags {
|
||||
if ((bits & SELECTABLE) == SELECTABLE) builder.append("SELECTABLE").append("|");
|
||||
if ((bits & SELECTED) == SELECTED) builder.append("SELECTED").append("|");
|
||||
if ((bits & INVISIBLE) == INVISIBLE) builder.append("INVISIBLE").append("|");
|
||||
if ((bits & RUNNING) == RUNNING) builder.append("RUNNING").append("|");
|
||||
if (builder.length() > 0) builder.setLength(builder.length() - 1);
|
||||
}
|
||||
return builder.toString();
|
||||
|
@ -6,9 +6,13 @@ import com.badlogic.gdx.utils.Pool;
|
||||
|
||||
public class VelocityComponent implements Component, Pool.Poolable {
|
||||
public final Vector2 velocity = new Vector2();
|
||||
public float walkSpeed;
|
||||
public float runSpeed;
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
velocity.setZero();
|
||||
walkSpeed = 0;
|
||||
runSpeed = 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user