• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Joystick Movement Problem

T

Type Ace

Guest
Hello!

I am using a JOYSTICK, not a GAMEPAD.
I have a problem with the player movement (Player moves only LEFT. I want him to move RIGHT too).

this is the code (Step Event):
///Movement

if (joystick_direction(1) == vk_numpad6)
{
hspd = spd;
}
if (joystick_direction(1) == vk_numpad4)
{
hspd = -spd;
}


else
{
hspd = 0;
}



Can anybody help?
Thanks in advace & have a nice day :)
 
Last edited by a moderator:
T

Type Ace

Guest
OOO!

I figured it out!

I added an ELSE before the second if statment

/////////////////////////////////////////////////////////////////////////////
ELSE if (joystick_direction(1) == vk_numpad4)
{
hspd = -spd;
}
/////////////////////////////////////////////////////////////////////////////
 
Top