Deltarune (Chapter 2) script viewer

← back to main script listing

gml_GlobalScript_scr_rotatearoundobject

(view raw script w/o annotations or w/e)
1
function scr_rotatearoundobject
scr_rotatearoundobject

function scr_rotatearoundobject(arg0, arg1) { var __theta = point_direction(arg0.x, arg0.y, x, y); var __radius = point_distance(arg0.x, arg0.y, x, y); __theta += arg1; x = arg0.x + lengthdir_x(__radius, __theta); y = arg0.y + lengthdir_y(__radius, __theta); direction += arg1; }
(arg0, arg1)
2
{
3
    var __theta = point_direction(arg0.x, arg0.y, x, y);
4
    var __radius = point_distance(arg0.x, arg0.y, x, y);
5
    __theta += arg1;
6
    x = arg0.x + lengthdir_x(__radius, __theta);
7
    y = arg0.y + lengthdir_y(__radius, __theta);
8
    direction += arg1;
9
}