L

#### Ludicrous Raptor

##### Guest

Code:

```
//Camera Movement With Mouse
window_mouse_set(window_get_width() / 2, window_get_height() / 2);
if (mouse_x < 640) {
target_dir = target_dir + ((1 + mouse_x) / 640);
}
if (mouse_x > 640) {
target_dir = target_dir - ((1 + mouse_x) / 640);
}
//Movment With W,A,S,D (WALKING)
var forward = keyboard_check(ord('W'));
var backward = keyboard_check(ord('S'));
var right = keyboard_check(ord('D'));
var left = keyboard_check(ord('A'));
if(forward){
var vect_x = lengthdir_x(2,target_dir);
var vect_y = lengthdir_y(2,target_dir);
if(!place_meeting(target_x+vect_x, target_y+vect_y, obj_wall)){
target_x += vect_x;
target_y += vect_y;
if(place_meeting(target_x+vect_x, target_y+vect_y, obj_wall)){
target_x -= vect_x;
target_y -= vect_y;
}
}
}
if(backward){
var vect_x = lengthdir_x(2,target_dir);
var vect_y = lengthdir_y(2,target_dir);
if(!place_meeting(target_x+vect_x, target_y+vect_y, obj_wall)){
target_x -= vect_x;
target_y -= vect_y;
if(place_meeting(target_x+vect_x, target_y+vect_y, obj_wall)){
target_x += vect_x;
target_y += vect_y;
}
}
}
if(left){
var vect_x = lengthdir_x(1, target_dir + 90);
var vect_y = lengthdir_y(1, target_dir + 90);
if(!place_meeting(target_x+vect_x, target_y+vect_y, obj_wall)){
target_x += vect_x;
target_y += vect_y;
}
}
if(right){
var vect_x = lengthdir_x(1, target_dir - 90);
var vect_y = lengthdir_y(1, target_dir - 90);
if(!place_meeting(target_x+vect_x, target_y+vect_y, obj_wall)){
target_x += vect_x;
target_y += vect_y;
}
}
```