doodle/pkg/gamepad/enum.go
Noah Petherbridge 4de0126b19 Game Controller Support
Adds support for Xbox and Nintendo style game controllers. The gamepad
controls are documented on the README and in the game's Settings window.

The buttons are not customizable yet, except that the player can choose
between two button styles:

* X Style (default): "A" button is on the bottom and "B" on the right.
* N Style: swaps the A/B and the X/Y buttons to use a Nintendo-style
  layout instead of an Xbox-style.
2022-02-19 18:31:22 -08:00

30 lines
683 B
Go

package gamepad
// Enums and constants.
// Mode of controller behavior (Player One)
type Mode int
// Style of controller (Player One)
type Style int
// Controller mode options.
const (
// MouseMode: the joystick moves a mouse cursor around and
// the face buttons emulate mouse click events.
MouseMode Mode = iota
// GameplayMode: to control the player character during Play Mode.
GameplayMode
// EditorMode: to support the Level Editor.
EditorMode
)
// Controller style options.
const (
XStyle Style = iota // Xbox 360 layout (A button on bottom)
NStyle // Nintendo style (A button on right)
CustomStyle // Custom style (TODO)
)