angle=round(argument0/8)*8;
hspace=argument1;
check=argument2;
dcos=cos(degtorad(angle));
dsin=sin(degtorad(angle));
x1=round(x-( dcos * hspace ));
y1=round(y+( dsin * hspace ));
x2=round(x+( dcos * hspace ));
y2=round(y-( dsin * hspace ));
done1=0;
done2=0;
i=2.35;
while(i) {
if (!done1) {
if ((check&obstacle_layer) && collision_point(x1,y1,obj_walls,true,true)>0) done1=1;
if (layer==0 && (check&high_layer) && collision_point(x1,y1,obj_hlayer,true,true)>0) done1=1;
if (layer==1 && (check&low_layer) && collision_point(x1,y1,obj_llayer,true,true)>0) done1=1;
x1+=dsin;
y1+=dcos;
}
if (!done2) {
if ((check&obstacle_layer) && collision_point(x2,y2,obj_walls,true,true)>0) done2=1;
if (layer==0 && (check&high_layer) && collision_point(x2,y2,obj_hlayer,true,true)>0) done2=1;
if (layer==1 && (check&low_layer) && collision_point(x2,y2,obj_llayer,true,true)>0) done2=1;
x2+=dsin;
y2+=dcos;
}
if (done1 && done2) break;
i-=1;
}
return round( point_direction(x1,y1,x2,y2));
//Jump!
if (KEY_A && ground)
{
ground=0;
vsp=dcos*jmp-dsin*hsp;
hsp=dcos*hsp+dsin*jmp;
angle=0;
dcos=1;
dsin=0;
action=1;
}
Here is all of it.