View difference between Paste ID: GEwcv71v and FUhZV1vb
SHOW: | | - or go back to the newest paste.
1
Create:
2
target=-4;
3
Step:
4
if target!=-4
5
{
6
if distance_to_object(obj_enemy)>32
7
{
8
var dir;
9
dir=point_direction(x,y,target.x,target.y);
10
x=x+lengthdir_x(4,dir);
11
y=y+lengthdir_y(4,dir);
12
}
13
}
14
Collision with obj_enemy:
15-
if other.target==-4 and target==-4
15+
if other.target!=id and target==-4
16
{
17
target=other.id;
18
}