@@ -13,7 +13,7 @@ function Vector2(_x, _y) constructor {
13
13
x = _x;
14
14
y = _y;
15
15
16
- set = function () {
16
+ static set = function () {
17
17
var vector = argument[0 ];
18
18
19
19
if (argument_count > 1 ) {
@@ -26,12 +26,12 @@ function Vector2(_x, _y) constructor {
26
26
y = vector.y ;
27
27
}
28
28
29
- negative = function () {
29
+ static negative = function () {
30
30
x = -x;
31
31
y = -y;
32
32
}
33
33
34
- add = function () {
34
+ static add = function () {
35
35
var vector = argument[0 ];
36
36
37
37
if (argument_count > 1 ) {
@@ -44,7 +44,7 @@ function Vector2(_x, _y) constructor {
44
44
y += vector.y ;
45
45
}
46
46
47
- multi = function () {
47
+ static multi = function () {
48
48
var vector = argument[0 ];
49
49
50
50
if (argument_count > 1 ) {
@@ -57,20 +57,20 @@ function Vector2(_x, _y) constructor {
57
57
y *= vector.y ;
58
58
}
59
59
60
- zero = function () {
60
+ static zero = function () {
61
61
x = 0 ;
62
62
y = 0 ;
63
63
}
64
64
65
- to_string = function (delimiter = " :" ) {
65
+ static to_string = function (delimiter = " :" ) {
66
66
return string (x) + delimiter + string (y);
67
67
}
68
68
69
- _length = function () {
69
+ static _length = function () {
70
70
return sqr (x * x + y * y);
71
71
}
72
72
73
- _min = function () {
73
+ static _min = function () {
74
74
var vector = argument[0 ];
75
75
76
76
if (argument_count > 1 ) {
@@ -82,7 +82,7 @@ function Vector2(_x, _y) constructor {
82
82
return new Vector2 (min (x, vector.x ), min (y, vector.y ));
83
83
}
84
84
85
- _max = function () {
85
+ static _max = function () {
86
86
var vector = argument[0 ];
87
87
88
88
if (argument_count > 1 ) {
@@ -94,7 +94,7 @@ function Vector2(_x, _y) constructor {
94
94
return new Vector2 (max (x, vector.x ), max (y, vector.y ));
95
95
}
96
96
97
- _clamp = function () {
97
+ static _clamp = function () {
98
98
var vector_min = argument[0 ];
99
99
var vector_max = argument[1 ];
100
100
@@ -110,7 +110,7 @@ function Vector2(_x, _y) constructor {
110
110
return new Vector2 (clamp (x, vector_min.x , vector_max.x ), clamp (y, vector_min.y , vector_max.y ));
111
111
}
112
112
113
- _lerp = function () {
113
+ static _lerp = function () {
114
114
var vector = argument[0 ];
115
115
var amount = " 0.5" ;
116
116
@@ -129,7 +129,7 @@ function Vector2(_x, _y) constructor {
129
129
}
130
130
131
131
#region Dir
132
- __dir_base = function (dir, value, vector) {
132
+ static __dir_base = function (dir, value, vector) {
133
133
switch (dir) {
134
134
case vector2_dir.down :
135
135
vector.y = -value;
@@ -154,17 +154,17 @@ function Vector2(_x, _y) constructor {
154
154
}
155
155
}
156
156
157
- dir_set = function (dir, value) {
157
+ static dir_set = function (dir, value) {
158
158
__dir_base (dir, value, self);
159
159
}
160
160
161
- dir_add = function (dir, value) {
161
+ static dir_add = function (dir, value) {
162
162
var vector = new Vector2 (0 , 0 );
163
163
__dir_base (dir, value, vector);
164
164
self.add (vector);
165
165
}
166
166
167
- dir_multi = function (dir, value) {
167
+ static dir_multi = function (dir, value) {
168
168
var vector = new Vector2 (x, y);
169
169
__dir_base (dir, value, vector);
170
170
vector.min (new Vector2 (1 , 1 ));
0 commit comments