Skip to content
This repository was archived by the owner on May 19, 2022. It is now read-only.

Controller support #78

Open
DanielOaks opened this issue Aug 31, 2014 · 1 comment
Open

Controller support #78

DanielOaks opened this issue Aug 31, 2014 · 1 comment

Comments

@DanielOaks
Copy link
Contributor

I'm going through and trying to add decent controller support to the engine. It's not too difficult, but it does add a whole lot to the experience for those more comfortable with a controller than a keyboard and mouse (or those sitting on the couch and wanting to play).

Basic controller support is available in the game-controllers branch, with a few caveats:

  • In the event loop, KEYUP and KEYDOWN are swapped for controller button presses, to appear quicker and nicer. We really should just not smash them to KEYUP/DOWN, leave them as the CONTROLLERBUTTONUP/DOWN events, and then interpret those properly in keyPressEvents. Since we still call the correct keyUp/DownEvent() for the press and don't swap that as well, we shouldn't get into any undefined/bad states hopefully.
  • We should make game controllers and joysticks pluggable/unpluggable. Right now it only lets you use one if it's plugged in at game start.

I'm currently implementing the controls as mapped in the (apparently) existing PSP controls, which work pretty well.

If there are any other suggestions with regards to button controls, please just post them here!

edit:
Just pushed the update to snap the mouse pointer to the default button when the player isn't using mouse-based movement. This improves the experience quite a bit for both game controllers and keyboards, making it nicer to see which item you're on when the screen changes!

@DanielOaks DanielOaks self-assigned this Aug 31, 2014
@DanielOaks
Copy link
Contributor Author

Game controller support is now merged into master. It's implemented similarly to joystick support, so right now it only supports game controllers plugged in when Ponscripter first starts up.

If we want to we can add hotpluggable controller support, but I'm alright with where this support is right now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant