I realize you have this working now but if you or someone wanted to make your own instead of using that default script, I believe this works without issues:
Variables at the top of the Global Script (outside of a function)
Code: ags
Inside repeatedly execute in the Global Script
Code: ags
Variables at the top of the Global Script (outside of a function)
bool keyboardMovement;
int keyboardMovementDirection;
Inside repeatedly execute in the Global Script
if (!IsGamePaused() && IsInterfaceEnabled() && player.on)
{
bool dUp, dRight, dDown, dLeft;
int newDirection;
if (IsKeyPressed(eKeyUpArrow)) dUp=true;
if (IsKeyPressed(eKeyRightArrow)) dRight=true;
if (IsKeyPressed(eKeyDownArrow)) dDown=true;
if (IsKeyPressed(eKeyLeftArrow)) dLeft=true;
if (dUp && dRight) newDirection=2;
else if (dRight && dDown) newDirection=4;
else if (dDown && dLeft) newDirection=6;
else if (dLeft && dUp) newDirection=8;
else if (dUp) newDirection=1;
else if (dRight) newDirection=3;
else if (dDown) newDirection=5;
else if (dLeft) newDirection=7;
else newDirection=0; //nothing
if (newDirection!=keyboardMovementDirection)
{
keyboardMovement=true;
int newX, newY;
if (newDirection==1 || newDirection==2 || newDirection==8) newY=-1000;
else if (newDirection==4 || newDirection==5 || newDirection==6) newY=1000;
if (newDirection==2 || newDirection==3 || newDirection==4) newX=1000;
else if (newDirection==6 || newDirection==7 || newDirection==8) newX=-1000;
player.WalkStraight(player.x+newX, player.y+newY, eNoBlock);
keyboardMovementDirection=newDirection;
}
else if (newDirection==0 && keyboardMovement)
{
keyboardMovement=false;
player.StopMoving();
}
}