use of com.ilargia.games.logicbrick.component.input.Input in project Entitas-Java by Rubentxu.
the class InputEntity method replaceInput.
public InputEntity replaceInput(int x, int y) {
Input component = (Input) recoverComponent(InputComponentsLookup.Input);
if (component == null) {
component = new Input(x, y);
} else {
component.x = x;
;
component.y = y;
}
replaceComponent(InputComponentsLookup.Input, component);
return this;
}
use of com.ilargia.games.logicbrick.component.input.Input in project Entitas-Java by Rubentxu.
the class InputEntity method addInput.
public InputEntity addInput(int x, int y) {
Input component = (Input) recoverComponent(InputComponentsLookup.Input);
if (component == null) {
component = new Input(x, y);
} else {
component.x = x;
;
component.y = y;
}
addComponent(InputComponentsLookup.Input, component);
return this;
}
use of com.ilargia.games.logicbrick.component.input.Input in project Entitas-Java by Rubentxu.
the class ProcessInputSystem method execute.
@Override
protected void execute(List<InputEntity> entities) {
InputEntity inputEntity = entities.get(0);
Input input = inputEntity.getInput();
Set<GameEntity> interactives = EntityIndexExtension.getEntitiesWithPosition(entitas.game, input.x, input.y).stream().filter(e -> e.isInteractive()).collect(Collectors.toSet());
for (GameEntity e : interactives) {
e.setDestroy(true);
}
}
Aggregations