rm push/pop

This commit is contained in:
2026-02-26 08:13:27 -06:00
parent ef7e3e6449
commit ce6b0ddb3a
31 changed files with 251 additions and 255 deletions

View File

@@ -73,7 +73,7 @@ collision2d.overlap = function(body, pos, others) {
for (i = 0; i < length(others); i++) {
other = others[i]
if (collision2d.test(body, pos, other.body, other.pos))
push(results, other)
results[] = other
}
return results
}
@@ -94,12 +94,12 @@ collision2d.overlap_point = function(point, bodies) {
hw = b.body.width * 0.5
hh = b.body.height * 0.5
if (abs(point.x - c.x) < hw && abs(point.y - c.y) < hh)
push(results, b)
results[] = b
} else if (b.body.type == 'circle') {
dx = point.x - c.x
dy = point.y - c.y
if (dx * dx + dy * dy < b.body.radius * b.body.radius)
push(results, b)
results[] = b
}
}
return results