Skip to content

Commit

Permalink
Fix keyboard issues
Browse files Browse the repository at this point in the history
  • Loading branch information
armin-reichert committed Nov 10, 2024
1 parent 94abf7a commit 81678e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public void bindGameActions() {}
@Override
protected void doInit() {
context.setScoreVisible(true);
ArcadeKeyAdapter arcadeController = context.arcade();
bindDefaultArcadeControllerActions(this, arcadeController);
bindFallbackPlayerControlActions(this);
registerGameActionKeyBindings(context.keyboard());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,24 @@ public final void end() {
public void bindGameActions() {
bind(GameActions3D.PREV_PERSPECTIVE, alt(KeyCode.LEFT));
bind(GameActions3D.NEXT_PERSPECTIVE, alt(KeyCode.RIGHT));
if (context.level().isDemoLevel()) {
if (context.currentGameVariant() == GameVariant.MS_PACMAN_TENGEN) {
bind(TengenGameActions.QUIT_DEMO_LEVEL, context.joypad().keyCombination(NES.Joypad.START));
} else {
bind(GameActions2D.ADD_CREDIT, context.arcade().keyCombination(Arcade.Controls.COIN));
if (context.game().level().isPresent()) {
if (context.level().isDemoLevel()) {
if (context.currentGameVariant() == GameVariant.MS_PACMAN_TENGEN) {
bind(TengenGameActions.QUIT_DEMO_LEVEL, context.joypad().keyCombination(NES.Joypad.START));
} else {
bind(GameActions2D.ADD_CREDIT, context.arcade().keyCombination(Arcade.Controls.COIN));
}
}
}
else {
if (context.currentGameVariant() == GameVariant.MS_PACMAN_TENGEN) {
bindDefaultJoypadActions(this, context.joypad());
} else {
bindDefaultArcadeControllerActions(this, context.arcade());
else {
if (context.currentGameVariant() == GameVariant.MS_PACMAN_TENGEN) {
bindDefaultJoypadActions(this, context.joypad());
} else {
bindDefaultArcadeControllerActions(this, context.arcade());
}
bindFallbackPlayerControlActions(this);
bindCheatActions(this);
context.setScoreVisible(true); //TODO check this
}
bindFallbackPlayerControlActions(this);
bindCheatActions(this);
context.setScoreVisible(true); //TODO check this
}
registerGameActionKeyBindings(context.keyboard());
}
Expand Down

0 comments on commit 81678e7

Please sign in to comment.