G

G

T

Code:

```
angle = point_direction(x, y, mouse_x, mouse_y);
max_speed = 5;
if(keyboard_check(ord("W"))){
x += max_speed * dcos(angle);
y += max_speed * dsin(angle);
}
if(keyboard_check(ord("S"))){
x -= max_speed * dcos(angle);
y -= max_speed * dsin(angle);
}
```

Since Game Maker uses up as -y and down as +y, it may actually be this:

Code:`angle = point_direction(x, y, mouse_x, mouse_y); max_speed = 5; if(keyboard_check(ord("W"))){ x += max_speed * dcos(angle); y += max_speed * dsin(angle); } if(keyboard_check(ord("S"))){ x -= max_speed * dcos(angle); y -= max_speed * dsin(angle); }`

Code:

```
angle = point_direction(x, y, mouse_x, mouse_y);
max_speed = 5;
if(keyboard_check(ord("W"))){
x += max_speed * dcos(angle);
y -= max_speed * dsin(angle);
}
if(keyboard_check(ord("S"))){
x -= max_speed * dcos(angle);
y += max_speed * dsin(angle);
}
```

G

well this solves the forward and backward problem but what about left and right? It might be simple but i can not figure out how. The only way that i can think of is making it move 90 degrees from that direction but i dont know howSince Game Maker uses up as -y and down as +y, it may actually be this:

Code:`angle = point_direction(x, y, mouse_x, mouse_y); max_speed = 5; if(keyboard_check(ord("W"))){ x += max_speed * dcos(angle); y -= max_speed * dsin(angle); } if(keyboard_check(ord("S"))){ x -= max_speed * dcos(angle); y += max_speed * dsin(angle); }`

Code:

```
angle = point_direction(x, y, mouse_x, mouse_y);
max_speed = 5;
if(keyboard_check(ord("W"))){
x += max_speed * dcos(angle);
y -= max_speed * dsin(angle);
}
if(keyboard_check(ord("S"))){
x -= max_speed * dcos(angle);
y += max_speed * dsin(angle);
}
if(keyboard_check(ord("A"))){
x -= max_speed * dsin(angle);
y -= max_speed * dcos(angle);
}
if(keyboard_check(ord("D"))){
x += max_speed * dsin(angle);
y += max_speed * dcos(angle);
}
```