QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: SirCrow on August 21, 2018, 05:15:25 pm
-
Okay, so _MOUSEINPUT is how we check for any new mouse info; is there an equivalent for a joystick?
Or do I always have to check for every possible move or button press using STICK and STRIG? Thanks.
-
http://qb64.org/wiki/DEVICES <--- If you're looking for joystick support, this is the set of commands you'll want to use.
IF d&
THEN ' the device number cannot be zero!
-
I just tried the listings in the wiki DEVICES... Mouse worked great...
Dare I test my dust covered joystick? Dare I did...
It detected all 12 buttons and all 6 axes... Cool.
Are there any QB64 games that are written for a stick? (I know... I know... 'Why not try making one'? Right? *sigh*)
-
My Spaceship game does use a joystick if available: https://github.com/FellippeHeitor/Spaceship
-
I think the game is looking for a gamepad-like device as a controller. It detects my joystick ok but when assigning the functions it's asking for 'buttons' and will not accept the stick axes. I do not know enough of QB64 and it's stick commands to fix it. Sorry.
J
-
I programmed it to use buttons only indeed. I play it at home with a PS4 controller.
-
Not a problem. At least I can still use the keyboard... lol Besides, keyboard; stick or pad, I still get killed off to quickly... lol
-
http://qb64.org/wiki/DEVICES (http://qb64.org/wiki/DEVICES) <--- If you're looking for joystick support, this is the set of commands you'll want to use. .
.
.
.
Thanks. I tried IF _DEVICEINPUT(3) THEN ... and it seems to work, but I can't get it to turn my spaceship and fire at the same time...at least not very nicely.
There's a conflict of some kind, and I can't identify it. I'll keep working on it.
-
UPDATE: I've figured it out and now my StarBlast ship can both turn and fire simultaneously using a joystick.
Now it's just a matter of tweaking it and getting over the initial awkwardness of controlling it in this new way.