use of ilargia.egdx.api.GameController in project Entitas-Java by Rubentxu.
the class InputManagerGDX method update.
@Override
public void update(float deltaTime) {
//for every keystate, set pressed and released to false.
for (int i = 0; i < 256; i++) {
KeyState k = inputStateData.keyStates[i];
k.pressed = false;
k.released = false;
}
for (int i = 0; i < inputStateData.pointerStates.length; i++) {
PointerState<Vector2, Vector3> t = inputStateData.pointerStates[i];
if (t.down && !t.pressed)
t.clickTime += deltaTime;
t.pressed = false;
t.released = false;
t.displacement.x = 0;
t.displacement.y = 0;
}
if (entitas.actuator.hasDragActuator() && jointDef == null) {
this.dragActuator = entitas.actuator.getDragActuator();
jointDef = new MouseJointDef();
jointDef.bodyA = Indexed.getInteractiveEntity(dragActuator.targetEntity).getRigidBody().body;
jointDef.collideConnected = dragActuator.collideConnected;
jointDef.maxForce = dragActuator.maxForce;
}
for (GameController controller : controllers) {
controller.update(this, entitas);
}
}
Aggregations