[gml]// script(fx, fy, lx, ly, obj, n);
var fx, fy, lx, ly, obj, n, l, d;
fx = argument0;
fy = argument1;
lx = argument2;
ly = argument3;
obj = argument4;
n = argument5;
l = point_distance(fx, fy, lx, ly) / n;
d = point_direction(fx, fy, lx, ly);
for (i = 0; i <= n; i += 1) {
instance_create(fx + lengthdir_x(l, d) * i, fy + lengthdir_y(l, d) * i);
}[/gml]
Es un script, ponele el nombre que quieras y llamalo con los siguientes argumentos:
0: x inicial,
1: y inicial,
2: x final,
3: y final,
4: objeto a crear,
5: n?mero de objetos a crear.
Tu ejemplo ser?a as?, si el script se llama "tengo_hambre":
[gml]tengo_hambre(0, 0, 0, 128, objEstrella, 5);[/gml]
No est? probado.
var fx, fy, lx, ly, obj, n, l, d;
fx = argument0;
fy = argument1;
lx = argument2;
ly = argument3;
obj = argument4;
n = argument5;
l = point_distance(fx, fy, lx, ly) / n;
d = point_direction(fx, fy, lx, ly);
for (i = 0; i <= n; i += 1) {
instance_create(fx + lengthdir_x(l, d) * i, fy + lengthdir_y(l, d) * i);
}[/gml]
Es un script, ponele el nombre que quieras y llamalo con los siguientes argumentos:
0: x inicial,
1: y inicial,
2: x final,
3: y final,
4: objeto a crear,
5: n?mero de objetos a crear.
Tu ejemplo ser?a as?, si el script se llama "tengo_hambre":
[gml]tengo_hambre(0, 0, 0, 128, objEstrella, 5);[/gml]
No est? probado.