1
Programs / Re: Master Sword v1.2
« on: December 19, 2021, 07:12:01 pm »
I completely redid the controller code. This should work better.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
you could allow controllers with various button counts by using this to select what button to use for what:Code: QB64: [Select]
NEXT i%%
then you assign that button to the control, and it wont matter if they have 4 buttons or 24 buttons.
say you picked the controller button to be used for 'A' assign:Controller.A = Bselect%%
and I'm not sure if STRIG() will pull it off anyway looking at the WIKI page. based on the following line from the WIKI
"Odd devices use 0, 1, 4, 5, 8 and 9 and Even devices use 2, 3, 6, 7, 10 and 11 as first parameters with device number following."
(you were using 0,4,8; all inline with an Odd device number)
So I don't know if my button 2 or 10 would even work with STRIG() as my controller is an odd device number(reported as 3)
I would have recommended using _BUTTON() instead.
And I don't think you can assign the Dpad buttons correctly for the same reason.
Even though my Dpad returns as 2 axis, it only returns 3 values for each axis -1,0,1 that is it.
And custom keyboard controls could be done in a similar manor, you have a menu where the player selects what button they want to customize then you get what they pressed and assign it for that button.
Looking at the code it doesn't appear that it would be too terribly hard to swap out STRIG for _BUTTON, and probably STICK for _AXIS, but then I haven't looked through that much.
Now I know the keyboard controls I will see about giving it a run though!
how my computer registers the 4 buttons on the controller.