Excalibur
Excalibur copied to clipboard
feat: [#2460] add support for wasButtonPressed and wasButtonReleased
===:clipboard: PR Checklist :clipboard:===
- [x] :pushpin: issue exists in github for these changes
- [x] :microscope: existing tests still pass
- [x] :see_no_evil: code conforms to the style guide
- [x] :triangular_ruler: new tests written and passing / old tests updated with new scenario(s)
- [x] :page_facing_up: changelog entry added (or not needed)
==================
Closes #2460
Changes:
- add support for gamepad wasButtonPressed and wasButtonReleased
@eonarheim let me know what you think of these changes. I searched for existing test suites for gamepad's isButtonPressed
so I could add ones for these new methods, but I only found it referenced in a sandbox, so I updated that instead. If you think there's an appropriate way to test it then I'd be happy to do that!
This doesn't contain the proposed change of renaming isButtonPressed
to isButtonHeld
as I'm not sure if we're in favour of that or not.
@mattjennings That's fine, the sandbox should be okay since there are no unit tests (and I'm not positive how I would unit test the GamePad API either)
I mentioned in the issue, but I'm in favor of the name change for consistency 👍 we can mark the old name @deprecated
in the jsdoc and changelog.
@eonarheim perfect, should be good to go now!