2 |
scr_verlet_updatepointsscr_verlet_updatepointsfunction scr_verlet_updatepoints(argument0, argument1, argument2) //gml_Script_scr_verlet_updatepoints
{
for (var i = 0; i < array_length(argument0); i++)
{
var p = array_get(argument0, i)
if (!(array_get(p, 4)))
{
var vx = ((array_get(p, 0)) - (array_get(p, 2))) * argument1
var vy = ((array_get(p, 1)) - (array_get(p, 3))) * argument1
array_set(p, 2, array_get(p, 0))
array_set(p, 3, array_get(p, 1))
array_set(p, 0, ((array_get(p, 0)) + vx))
array_set(p, 1, ((array_get(p, 1)) + vy))
array_set(p, 1, ((array_get(p, 1)) + argument2))
}
}
} (points, p_friction, p_gravity) |
5 |
scr_verlet_updatesticksscr_verlet_updatesticksfunction scr_verlet_updatesticks(argument0) //gml_Script_scr_verlet_updatesticks
{
for (var i = 0; i < array_length(argument0); i++)
{
var s = array_get(argument0, i)
var dx = (array_get(array_get(s, 1), 0)) - (array_get(array_get(s, 0), 0))
var dy = (array_get(array_get(s, 1), 1)) - (array_get(array_get(s, 0), 1))
var distance = sqrt(dx * dx + dy * dy)
var difference = (array_get(s, 2)) - distance
var percent = difference / distance / 2
var offsetX = dx * percent
var offsetY = dy * percent
if (!(array_get(array_get(s, 0), 4)))
{
array_set(array_get(s, 0), 0, ((array_get(array_get(s, 0), 0)) - offsetX))
array_set(array_get(s, 0), 1, ((array_get(array_get(s, 0), 1)) - offsetY))
}
if (!(array_get(array_get(s, 1), 4)))
{
array_set(array_get(s, 1), 0, ((array_get(array_get(s, 1), 0)) + offsetX))
array_set(array_get(s, 1), 1, ((array_get(array_get(s, 1), 1)) + offsetY))
}
}
} (sticks) |
6 |
scr_verlet_guardener_windscr_verlet_guardener_windfunction scr_verlet_guardener_wind(argument0) //gml_Script_scr_verlet_guardener_wind
{
for (var i = 0; i < array_length(argument0); i++)
{
var p = array_get(argument0, i)
if (!(array_get(p, 4)))
{
if position_meeting(array_get(p, 0), array_get(p, 1), obj_guardener_verlet_wind)
array_set(p, 0, ((array_get(p, 0)) - 0.025))
}
}
} (points) |