|
1
|
var _slash = instance_create(obj_growtangle.x + (flip ? 20 : -20), obj_growtangle.y, obj_roaringknight_quickslash);
|
|
2
|
var _xx = knight.x + 100;
|
|
3
|
var _minAngle = min_angle;
|
|
4
|
var _maxAngle = max_angle;
|
|
5
|
if (flip)
|
|
6
|
{
|
|
7
|
_minAngle -= 180;
|
|
8
|
_maxAngle -= 180;
|
|
9
|
_xx = obj_growtangle.x - abs(_xx - obj_growtangle.x);
|
|
10
|
}
|
|
11
|
with (_slash)
|
|
12
|
{
|
|
13
|
var _targetdir = point_direction(_xx, obj_growtangle.y, obj_heart.x + 8, obj_heart.y + 8);
|
|
14
|
other.count++;
|
|
15
|
flip = other.flip;
|
|
16
|
if (flip)
|
|
17
|
_targetdir = angle_difference(_targetdir, 0);
|
|
18
|
if (other.count == 5)
|
|
19
|
other.count = 0;
|
|
20
|
else
|
|
21
|
_targetdir += random_range(-other.spawn_range, other.spawn_range);
|
|
22
|
_targetdir = scr_pingpong_ext(_targetdir, _minAngle, _maxAngle);
|
|
23
|
if (flip)
|
|
24
|
{
|
|
25
|
image_xscale *= -1;
|
|
26
|
scr_orbitaroundpointscr_orbitaroundpoint
function scr_orbitaroundpoint(arg0, arg1, arg2)
{
var __theta = point_direction(arg0, arg1, x, y);
var __radius = point_distance(arg0, arg1, x, y);
__theta += arg2;
x = arg0 + lengthdir_x(__radius, __theta);
y = arg1 + lengthdir_y(__radius, __theta);
} (_xx, obj_growtangle.y, _targetdir);
|
|
27
|
}
|
|
28
|
else
|
|
29
|
{
|
|
30
|
_targetdir -= 180;
|
|
31
|
scr_orbitaroundpointscr_orbitaroundpoint
function scr_orbitaroundpoint(arg0, arg1, arg2)
{
var __theta = point_direction(arg0, arg1, x, y);
var __radius = point_distance(arg0, arg1, x, y);
__theta += arg2;
x = arg0 + lengthdir_x(__radius, __theta);
y = arg1 + lengthdir_y(__radius, __theta);
} (_xx, obj_growtangle.y, _targetdir);
|
|
32
|
}
|
|
33
|
image_angle = _targetdir;
|
|
34
|
direction = _targetdir;
|
|
35
|
}
|
|
36
|
if (flip_mode)
|
|
37
|
flip = !flip;
|