D
Deleted member 16767
Guest
I've searched for a string that can do this but it looks like there is none. I'd like to make gamepad an optional pick in my games settings menu.
if(using_gamepad)
{
xDir = gamepad_axis_value(0, gp_axislh);
}
else
{
xDir = keyboard_check(vk_right) - keybaord_check(vk_left)
}
switch_image_left = hspeed <=-1
switch_image_right = hspeed >=1
//Making it recognize the left stick as moving the player.
if gamepad_is_connected(0)
{
var haxis = gamepad_axis_value(0, gp_axislh);
var vaxis = gamepad_axis_value(0, gp_axislv);
direction = point_direction(0, 0, haxis, vaxis);
speed = point_distance(0 ,0, haxis, vaxis) * 8;
}
//The player flips image index depending on where the mouse cursor is.
if gamepad_is_connected(0)
{
if switch_image_left
{
window_mouse_set(obj_Player_Monk.x-10000, y)
image_xscale = -1
}
if switch_image_right
{
window_mouse_set(obj_Player_Monk.x+10000, y)
image_xscale = 1
}
//Step Event for directional images on mouse cursor direction.
facing = floor(point_direction(x, y, mouse_x, mouse_y));