D
DaHomie
Guest
inputDirection = point_direction(0,0,keyRight-keyLeft,keyDown-keyUp);
inputMagnitude = (keyRight - keyLeft != 0) || (keyDown - keyUp !=0);
hSpeed = lengthdir_x(inputMagnitude * speedWalk, inputDirection);
vSpeed= lengthdir_y(inputMagnitude * speedWalk, inputDirection);
x += hSpeed;
y += vSpeed
I dont think I understand how this code fully works. im following along a youtube tutorial and the person didnt really explain very well for me to understand any form of help is appreciated. if you could give me a run down for what does what would be great and helpful please and thank you.
inputMagnitude = (keyRight - keyLeft != 0) || (keyDown - keyUp !=0);
hSpeed = lengthdir_x(inputMagnitude * speedWalk, inputDirection);
vSpeed= lengthdir_y(inputMagnitude * speedWalk, inputDirection);
x += hSpeed;
y += vSpeed
I dont think I understand how this code fully works. im following along a youtube tutorial and the person didnt really explain very well for me to understand any form of help is appreciated. if you could give me a run down for what does what would be great and helpful please and thank you.