O
OhMyEnglishTeaBags
Guest
Hello. I was wondering if any of you could help me out? I am trying to make it so that when A and W or D and W are pressed the player will jump diagonally. I currently use:
if keyboard_check(ord('A')) and keyboard_check(ord('W'))
{
direction = 135; speed = 60;
}
if keyboard_check(ord('D')) and keyboard_check(ord('W'))
{
direction = 45; speed = 60;
}
The only problem with this is that the player can hold the keys and just 'float' away. I tried using _pressed but then the jump is so small it's barely a jump. I also tried editing the speeds but that does not help (and I know the speed is being edited because when I press W on its own it jumps higher with a greater speed value). I also tried disabling gravity but that had no effect.
Any help? Thanks.
if keyboard_check(ord('A')) and keyboard_check(ord('W'))
{
direction = 135; speed = 60;
}
if keyboard_check(ord('D')) and keyboard_check(ord('W'))
{
direction = 45; speed = 60;
}
The only problem with this is that the player can hold the keys and just 'float' away. I tried using _pressed but then the jump is so small it's barely a jump. I also tried editing the speeds but that does not help (and I know the speed is being edited because when I press W on its own it jumps higher with a greater speed value). I also tried disabling gravity but that had no effect.
Any help? Thanks.