本文整理汇总了Java中com.almasb.fxgl.input.ActionType.ON_ACTION属性的典型用法代码示例。如果您正苦于以下问题:Java ActionType.ON_ACTION属性的具体用法?Java ActionType.ON_ACTION怎么用?Java ActionType.ON_ACTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.almasb.fxgl.input.ActionType
的用法示例。
在下文中一共展示了ActionType.ON_ACTION属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: up
@OnUserAction(name = "Up", type = ActionType.ON_ACTION)
public void up() {
if (mode == GameMode.MP_CLIENT) {
getNet().getConnection().ifPresent(conn -> {
conn.send(new ClientMessage(true, false, false));
});
} else {
playerBat.up();
}
}
示例2: down
@OnUserAction(name = "Down", type = ActionType.ON_ACTION)
public void down() {
if (mode == GameMode.MP_CLIENT) {
getNet().getConnection().ifPresent(conn -> {
conn.send(new ClientMessage(false, true, false));
});
} else {
playerBat.down();
}
}
示例3: printLine
@OnUserAction(name = "Print Line", type = ActionType.ON_ACTION)
public void printLine() {
System.out.println("On Action");
}
示例4: moveLeft
@OnUserAction(name = "Move Left", type = ActionType.ON_ACTION)
public void moveLeft() {
playerPosition.translate(-5, 0);
}
示例5: moveRight
@OnUserAction(name = "Move Right", type = ActionType.ON_ACTION)
public void moveRight() {
playerPosition.translate(5, 0);
}
示例6: moveUp
@OnUserAction(name = "Move Up", type = ActionType.ON_ACTION)
public void moveUp() {
playerPosition.translate(0, -5);
}
示例7: moveDown
@OnUserAction(name = "Move Down", type = ActionType.ON_ACTION)
public void moveDown() {
playerPosition.translate(0, 5);
}