This didn't take me too long, it works pretty well if you're experienced with gm6
argument0: The distance at which the enemy will attack
argument1: The speed
argument2: whether or not to jump over obstacles
argument3: whether or not to jump over gaps
argument4: The right sprite
argument5: The left sprite
argument6: The x to attack (the destination)
argument7: The y to attack (the destination)
in scr_ai script enter
dis=point_distance(x,y,argument6,argument7)
dir=point_direction(x,y,argument6,argument7)
if dir>270 or dir<=90
{
dir_2=0
}
else
{
dir_2=180
}
if dis<argument0
{
if dir_2=0
{
sprite_index=argument4
if place_free(x+argument1,y)
{
x+=argument1
if place_free(x+argument1,y+1) and argument3=true and gravity=0
{
vspeed=-3.5
}
}
else
{
if gravity=0 and argument2=true
{
vspeed=-3.5
}
}
}
if dir_2=180
{
sprite_index=argument5
if place_free(x-argument1,y)
{
x-=argument1
if place_free(x-argument1,y+1) and argument3=true and gravity=0
{
vspeed=-3.5
}
}
else
{
if gravity=0 and argument2=true
{
vspeed=-3.5
}
}
}
}
oh yeah, for gravity, I suggest you use...
if place_free(x,y+1)
{
gravity=.1
}
else
{
gravity=0
}