SortBodiesTopBottom
arcade.SortBodiesTopBottom (Class)
Provides a stable merge sort implementation for sorting Body arrays from top to bottom (by y coordinate). This implementation maintains the order of equal elements and is optimized specifically for arcade.Body instances.
Static Members
Sorts the array of bodies from left to right based on their x position. This operation modifies the array in place and preserves the order of bodies with equal x positions.
Name | Type | Description |
---|---|---|
a |
Array<Body> | The array of bodies to sort. |
Private Members
Name | Type |
---|---|
a |
Body |
b |
Body |
Returns |
---|
Int |
Name | Type |
---|---|
a |
Array<Body> |
from |
Int |
to |
Int |
Name | Type |
---|---|
a |
Array<Body> |
from |
Int |
pivot |
Int |
to |
Int |
len1 |
Int |
len2 |
Int |
Name | Type |
---|---|
a |
Array<Body> |
from |
Int |
mid |
Int |
to |
Int |
Name | Type |
---|---|
m |
Int |
n |
Int |
Returns |
---|
Int |
Name | Type |
---|---|
a |
Array<Body> |
from |
Int |
to |
Int |
val |
Int |
Returns |
---|
Int |
Name | Type |
---|---|
a |
Array<Body> |
from |
Int |
to |
Int |
val |
Int |
Returns |
---|
Int |
Name | Type |
---|---|
a |
Array<Body> |
i |
Int |
j |
Int |
Name | Type |
---|---|
a |
Array<Body> |
i |
Int |
j |
Int |
Returns |
---|
Int |