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

docs: revise isKey/isButton checks and add examples #484

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

imaginarny
Copy link
Contributor

The most notable edition is making isButton..() methods obvious that param is optional, that check for any button is also possible, not only for certain. I've just stumbled across this in the docs and thought it's not possible.

As I was adding that, I went through all isButton..() and isKey..() check methods and added some basic examples as well, so there's use of all options like e.g.:

isKeyDown()
isKeyDown("jump")
isKeyDown(["left", "right"])

It covers the following:

isKeyDown()
isKeyPressed()
isKeyPressedRepeat()
isKeyReleased()

isButtonPressed()
isButtonDown()
isButtonReleased()

Copy link

pkg-pr-new bot commented Oct 29, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/kaplayjs/kaplay@484

commit: eaca214

@lajbel lajbel merged commit fd36942 into kaplayjs:master Oct 29, 2024
2 checks passed
niceEli added a commit that referenced this pull request Oct 31, 2024
#488)

Co-authored-by: imaginarny <gencurpeter@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

2 participants