HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.96k stars 432 forks source link

Joystick support #82

Closed Beeblerox closed 10 years ago

Beeblerox commented 12 years ago

for the help see:

Beeblerox commented 12 years ago

I've added basic Joystick functionality. For next possible improvements see issue #89

impaler commented 11 years ago

To get multiple axis from one gamepad it looks like we might need to rethink handleAxisMove in FlxJoystickManager to support multiple joystick axis.

Related http://www.nme.io/community/forums/general-discussion/right-analogue-stick-xbox-360-gamepad/

Also would need to see if this can be done in an "easy" way with multiple types ps3/xbox as the event array ids and buttons could be different.

Beeblerox commented 11 years ago

@impaler or we can create joystick configuration screen

Beeblerox commented 11 years ago

@impaler I've just tested my cousin's gamepad (which is very similar to playstation's gamepad, at least i think so - it is Logitech cordless rumblepad 2) and having access to joystickevent.axis array seems enough, since it contains info about both joysticks on controller (first two - about left, and other pair of values - for right joystick)

gamedevsam commented 11 years ago

The thing I wonder is if the joystick and button data is the same for similarly positioned buttons on different controllers. So for example, if 'A' and 'X' on Xbox and PS3 controllers send out the same key code. If they did then we wouldn't have to do anything special, but if not we need to figure out a solution for being able to remap keys and axis easily.