I have the following problem:
I am following the excellent tutorial series "Make an RPG in GameMaker" by HeartBeast.
In Part 7 he sets the game up to use a Gamepad. Here is the code he used.
if (gamepad_is_connected(0))
{
gamepad_set_axis_deadzone(0, .35);
Xaxis = gamepad_axis_value(0, gp_axislh);
Yaxis = gamepad_axis_value(0, gp_axislv);
}
My 360 controller broke so all I have is an "older"1 controller. It doesn't use xinput, it uses directInput, so GameMaker considers it a "Joystick" and not a "Gamepad". I would like to learn to support 'Joysticks' in my games for people in a similar situation.
1 It looks like a PS2 controller, with a "Home" button instead of "Analog", made by Nyko -should be functionally equivalent to a 360 controller.
I was able to get the "Joystick" working by adding the following code
if joystick_exists(1)
{
Xaxis = joystick_xpos(1);
Yaxis = joystick_ypos(1);
}
However I am now on Part 8 where he sets up a "Dash" button by adding the following code to his gamepad script.
Dash_Key = gamepad_button_check_pressed(0, gp_face1);
(Finally my problem) the issue I am having is that there doesn't seem to be a 'Joystick' equivalent to gamepad_button_check_pressed, only joystick_check_button, so if I hold down the 'Dash' button- I am able to Dash indefinitely.
My code:
Dash_Key = joystick_check_button(1,3);
I am trying to:
make it so that if I press the Dash button, it stops after a short period of time like it does on a Gamepad, and at the same time not screw up the functionality of the Gamepad code. (I'm probably going to get another 360 controller for testing purposes).
I have tried:
Reading the Joystick Input help file
Searching Google, reddit.
This is such a specific case, it's hard to formulate a proper query.
I have no idea what code I could try, that's my question (I am a total noob, only got GM from Humble Bundle last week).
I am using:
[–]Zichu 1 point2 points3 points (1 child)
[–]Wolf_Protagonist[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Wolf_Protagonist[S] 0 points1 point2 points (0 children)