Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: stick -> dpad in Buttons API #587

Open
lajbel opened this issue Jan 14, 2025 · 1 comment
Open

feat: stick -> dpad in Buttons API #587

lajbel opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lajbel
Copy link
Collaborator

lajbel commented Jan 14, 2025

No description provided.

@lajbel lajbel added the enhancement New feature or request label Jan 14, 2025
@lajbel lajbel self-assigned this Jan 14, 2025
@dragoncoder047
Copy link
Contributor

here is my suggestion, some would go in the global options like buttons

kaplay({
    buttons: {
        jump: {
            gamepad: ["south", "rstick:up"],
            //                 ^^^^^^^^^^^ virtual buttons available here
            keyboard: ["space"],
        }
    },
    // new entry vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    sticks: {
        move: {
            gamepad: [
                "lstick",
                {up: "dpad-up", left: "dpad-left",
                 right: "dpad-right", down: "dpad-down"}
            ],
            keyboard: [
                {up: "w", left: "a",
                 right: "d", down: "s"},
                {up: "up", left: "left",
                 right: "right", down: "down"}
                // could also have "wasd" and "arrows" as built-in options here
            ]
        }
    },
})

@lajbel lajbel added this to the 3001.1 milestone Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: TODO
Development

No branches or pull requests

2 participants