use of com.almasb.fxgl.entity.effect.WobbleEffect in project FXGL by AlmasB.
the class WobbleSample method initInput.
@Override
protected void initInput() {
DSLKt.onKeyDown(KeyCode.F, "asd", () -> {
player.getControl(EffectControl.class).startEffect(new WobbleEffect(Duration.seconds(3), 3, 7, Orientation.VERTICAL));
});
DSLKt.onKeyDown(KeyCode.G, "asd2", () -> {
player.getControl(EffectControl.class).startEffect(new WobbleEffect(Duration.seconds(3), 2, 4, Orientation.HORIZONTAL));
});
}
use of com.almasb.fxgl.entity.effect.WobbleEffect in project FXGL by AlmasB.
the class MarioApp method initInput.
@Override
protected void initInput() {
getInput().addAction(new UserAction("Left") {
@Override
protected void onAction() {
player.getControl(PlayerControl.class).left();
}
}, KeyCode.A);
getInput().addAction(new UserAction("Right") {
@Override
protected void onAction() {
player.getControl(PlayerControl.class).right();
}
}, KeyCode.D);
getInput().addAction(new UserAction("Jump") {
@Override
protected void onAction() {
player.getControl(PlayerControl.class).jump();
}
}, KeyCode.W);
DSLKt.onKeyDown(KeyCode.F, "asd", () -> {
player.getControl(EffectControl.class).startEffect(new WobbleEffect(Duration.seconds(3), 3, 7, Orientation.VERTICAL));
});
DSLKt.onKeyDown(KeyCode.G, "asd2", () -> {
player.getControl(EffectControl.class).startEffect(new WobbleEffect(Duration.seconds(3), 2, 4, Orientation.HORIZONTAL));
});
}
Aggregations