GameMaker: Studio

GameMaker: Studio

Find, play, and make games easily
Discover, rate, and download the best player-created games made in GameMaker: Studio for free. Or try making your own and share with the community. Click here to learn more.
NeM 20 Jun, 2016 @ 6:12am
Using Joystick in menu like the "gamepad_button_check_pressed" command, but on stick !
Hi everyone,

I'm looking for a way to use the Joystick of pads like the "gamepad_button_check_pressed" command, at this point, it work more like "gamepad_button_pressed" and never stop.

I tried some things but... Like this :

------------------------------------------------------------------------------------------------------------
gamepad_set_axis_deadzone(0, 0.5);

axisrv_inter=gamepad_axis_value(0,gp_axisrv)
axislv_inter=gamepad_axis_value(0,gp_axislv)

if (axisrv_inter <0.5 & axisrv_inter >-0.5) || (axislv_inter <0.5 & axislv_inter >-0.5)
{
global.gamepad_axis_lock_v=0
}
else
{
global.gamepad_axis_lock_v=1;
}

if global.gamepad_axis_lock_v==0
{
if keyboard_check_pressed(vk_down)
|| gamepad_button_check_pressed(0,gp_padd)
|| axislv_inter >0.5
|| axislv_inter >0.5
{
choice_main_menu+=1;
audio_play_sound(sound_switch,0,false);
}
}

if global.gamepad_axis_lock_v==0
{
if keyboard_check_pressed(vk_up)
|| gamepad_button_check_pressed(0,gp_padu)
|| axisrv_inter <-0.5
|| axisrv_inter <-0.5
{
choice_main_menu-=1;
audio_play_sound(sound_switch,0,false);
}
}
-----------------------------------------------------------------------------------------------
But it wont work at all.

Any idea ? :)